ibps-container-frame.spec.js 936 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { mount } from '@vue/test-utils'
  2. import IbpsContainerFrame from '@/components/ibps-container-frame/index.vue'
  3. describe('ibps-container-frame', () => {
  4. // 存在且是Vue组件实例
  5. it('is a vue instance', () => {
  6. const wrapper = mount(IbpsContainerFrame, {
  7. stubs: ['ibps-container']
  8. })
  9. expect(wrapper.exists()).toBeTruthy()
  10. expect(wrapper.isVueInstance()).toBeTruthy()
  11. })
  12. // 包含特定类名
  13. it('contains specific classnames', () => {
  14. const wrapper = mount(IbpsContainerFrame, {
  15. stubs: ['ibps-container']
  16. })
  17. expect(wrapper.contains('.ibps-container-frame')).toBeTruthy()
  18. })
  19. // props
  20. it('has props', () => {
  21. const wrapper = mount(IbpsContainerFrame, {
  22. stubs: ['ibps-container'],
  23. propsData: {
  24. src: 'https://bpmhome.cn/ibps-admin/doc/zh/'
  25. }
  26. })
  27. expect(wrapper.props().src).toEqual('https://bpmhome.cn/ibps-admin/doc/zh/')
  28. })
  29. })