diff --git a/devui/icon/__tests__/icon.spec.ts b/devui/icon/__tests__/icon.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..91424ad144ad1dccd13c6259fad610405b318925 --- /dev/null +++ b/devui/icon/__tests__/icon.spec.ts @@ -0,0 +1,30 @@ +import { mount } from '@vue/test-utils'; +import Icon from '../src/icon'; + +describe('d-icon', () => { + it('name', () => { + const wrapper = mount(Icon, { + props: { name:'add' }, + }); + expect(wrapper.find('.icon-add').exists()).toBeTruthy(); + }); + + it('classPrefix', () => { + const wrapper = mount(Icon, { + props: { name:'add',classPrefix:'dev' }, + }); + expect(wrapper.find('.dev-add').exists()).toBeTruthy(); + }); + it('size', () => { + const wrapper = mount(Icon, { + props: { name:'add',size:'80px'}, + }); + expect(wrapper.find('.icon-add').attributes('style').includes('font-size: 80px')).toBeTruthy(); + }); + it('color', () => { + const wrapper = mount(Icon, { + props: { name:'add',color:'red'}, + }); + expect(wrapper.find('.icon-add').attributes('style').includes('color: red')).toBeTruthy(); + }); +}) \ No newline at end of file