ibps-link-btn.spec.js 807 B

123456789101112131415161718192021222324252627282930
  1. import { mount } from '@vue/test-utils'
  2. import IbpsLinkBtn from '@/components/ibps-link-btn/index.vue'
  3. describe('ibps-link-btn', () => {
  4. // 存在且是Vue组件实例
  5. it('is a vue instance', () => {
  6. const wrapper = mount(IbpsLinkBtn, {
  7. stubs: ['el-button-group', 'el-button', 'ibps-icon']
  8. })
  9. expect(wrapper.exists()).toBeTruthy()
  10. expect(wrapper.isVueInstance()).toBeTruthy()
  11. })
  12. // props
  13. it('has props', () => {
  14. const wrapper = mount(IbpsLinkBtn, {
  15. stubs: ['el-button-group', 'el-button', 'ibps-icon'],
  16. propsData: {
  17. title: 'title',
  18. icon: 'icon',
  19. link: 'link'
  20. }
  21. })
  22. expect(wrapper.props().title).toEqual('title')
  23. expect(wrapper.props().icon).toEqual('icon')
  24. expect(wrapper.props().link).toEqual('link')
  25. })
  26. })