12345678910111213141516171819202122232425262728293031 |
- // +----------------------------------------------------------------------
- // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2016~2023 https://www.crmeb.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
- // +----------------------------------------------------------------------
- // | Author: CRMEB Team <admin@crmeb.com>
- // +----------------------------------------------------------------------
- import { shallowMount } from '@vue/test-utils'
- import SvgIcon from '@/components/SvgIcon/index.vue'
- describe('SvgIcon.vue', () => {
- it('iconClass', () => {
- const wrapper = shallowMount(SvgIcon, {
- propsData: {
- iconClass: 'test'
- }
- })
- expect(wrapper.find('use').attributes().href).toBe('#icon-test')
- })
- it('className', () => {
- const wrapper = shallowMount(SvgIcon, {
- propsData: {
- iconClass: 'test'
- }
- })
- expect(wrapper.classes().length).toBe(1)
- wrapper.setProps({ className: 'test' })
- expect(wrapper.classes().includes('test')).toBe(true)
- })
- })
|