Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

23 rader
621 B

  1. import { shallowMount } from '@vue/test-utils'
  2. import SvgIcon from '@/components/SvgIcon/index.vue'
  3. describe('SvgIcon.vue', () => {
  4. it('iconClass', () => {
  5. const wrapper = shallowMount(SvgIcon, {
  6. propsData: {
  7. iconClass: 'test'
  8. }
  9. })
  10. expect(wrapper.find('use').attributes().href).toBe('#icon-test')
  11. })
  12. it('className', () => {
  13. const wrapper = shallowMount(SvgIcon, {
  14. propsData: {
  15. iconClass: 'test'
  16. }
  17. })
  18. expect(wrapper.classes().length).toBe(1)
  19. wrapper.setProps({ className: 'test' })
  20. expect(wrapper.classes().includes('test')).toBe(true)
  21. })
  22. })