天波用户运营管理后台系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SvgIcon.spec.js 621B

3 anni fa
12345678910111213141516171819202122
  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. })