From 983a1bcb2f7ec91ac456a1c98ad44b8b58e167c5 Mon Sep 17 00:00:00 2001 From: wzhaofei <505139165@qq.com> Date: Sat, 16 Oct 2021 02:25:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0icon=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/icon/__tests__/icon.spec.ts | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 devui/icon/__tests__/icon.spec.ts diff --git a/devui/icon/__tests__/icon.spec.ts b/devui/icon/__tests__/icon.spec.ts new file mode 100644 index 00000000..b219811a --- /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:'test' }, + }); + expect(wrapper.find('.icon-test').exists()).toBeTruthy(); + }); + + it('classPrefix', () => { + const wrapper = mount(Icon, { + props: { name:'test',classPrefix:'dev' }, + }); + expect(wrapper.find('.dev-test').exists()).toBeTruthy(); + }); + it('size', () => { + const wrapper = mount(Icon, { + props: { name:'test',size:'80px'}, + }); + expect(wrapper.find('.icon-test').attributes('style').includes('font-size: 80px')).toBeTruthy(); + }); + it('color', () => { + const wrapper = mount(Icon, { + props: { name:'test',color:'red'}, + }); + expect(wrapper.find('.icon-test').attributes('style').includes('color: red')).toBeTruthy(); + }); +}) \ No newline at end of file -- Gitee From b678eacaba728219a4e7ff9b8e7c6a524f9ec698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8B=9B=E9=A3=9E?= Date: Sat, 16 Oct 2021 12:53:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9icon=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=B5=8B=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devui/icon/__tests__/icon.spec.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/devui/icon/__tests__/icon.spec.ts b/devui/icon/__tests__/icon.spec.ts index b219811a..91424ad1 100644 --- a/devui/icon/__tests__/icon.spec.ts +++ b/devui/icon/__tests__/icon.spec.ts @@ -4,27 +4,27 @@ import Icon from '../src/icon'; describe('d-icon', () => { it('name', () => { const wrapper = mount(Icon, { - props: { name:'test' }, + props: { name:'add' }, }); - expect(wrapper.find('.icon-test').exists()).toBeTruthy(); + expect(wrapper.find('.icon-add').exists()).toBeTruthy(); }); it('classPrefix', () => { const wrapper = mount(Icon, { - props: { name:'test',classPrefix:'dev' }, + props: { name:'add',classPrefix:'dev' }, }); - expect(wrapper.find('.dev-test').exists()).toBeTruthy(); + expect(wrapper.find('.dev-add').exists()).toBeTruthy(); }); it('size', () => { const wrapper = mount(Icon, { - props: { name:'test',size:'80px'}, + props: { name:'add',size:'80px'}, }); - expect(wrapper.find('.icon-test').attributes('style').includes('font-size: 80px')).toBeTruthy(); + expect(wrapper.find('.icon-add').attributes('style').includes('font-size: 80px')).toBeTruthy(); }); it('color', () => { const wrapper = mount(Icon, { - props: { name:'test',color:'red'}, + props: { name:'add',color:'red'}, }); - expect(wrapper.find('.icon-test').attributes('style').includes('color: red')).toBeTruthy(); + expect(wrapper.find('.icon-add').attributes('style').includes('color: red')).toBeTruthy(); }); }) \ No newline at end of file -- Gitee