From beb144c86cf8e6d35ad6b41f3852e496684ef689 Mon Sep 17 00:00:00 2001 From: Sagi Date: Sun, 18 Sep 2022 23:13:57 +0800 Subject: [PATCH] test: add unit test case --- .../button-edit/test/button-edit.spec.tsx | 62 +++++++++++++++---- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/packages/ui-vue/components/button-edit/test/button-edit.spec.tsx b/packages/ui-vue/components/button-edit/test/button-edit.spec.tsx index 76a0bbd8d9..f48c04ea08 100644 --- a/packages/ui-vue/components/button-edit/test/button-edit.spec.tsx +++ b/packages/ui-vue/components/button-edit/test/button-edit.spec.tsx @@ -1,17 +1,57 @@ import { mount } from '@vue/test-utils'; import { ButtonEdit } from '..'; -describe('f-input-group', () => { - it('variant', () => { - const wrapper = mount({ - setup() { - return () => { - return ; - }; - }, - }); +describe('f-button-edit', () => { + const mocks = {}; + + beforeAll(() => {}); - expect(wrapper.find('.f-cmp-inputgroup').exists()).toBeTruthy(); - expect(wrapper.find('div').find('div').find('input').find('[readlony]').exists).toBeTruthy(); + describe('properties', () => { + it('should has default props', () => {}); + it('should has auto complete', () => {}); + it('should net has auto complete', () => {}); + it('should be disabled', () => {}); + it('should net be disabled', () => {}); + it('should be editable', () => { + const wrapper = mount({ + setup(props, ctx) { + return () => { + return ; + }; + }, + }); + expect(wrapper.find('div').find('div').find('input').attributes['readonly']).toBeFalsy(); + }); + it('should not be editable', () => { + const wrapper = mount({ + setup(props, ctx) { + return () => { + return ; + }; + }, + }); + expect(wrapper.find('.f-cmp-inputgroup').exists()).toBeTruthy(); + expect(wrapper.find('div').find('div').find('input').find('[readonly]').exists).toBeTruthy(); + }); + it('should show clear button', () => {}); + it('should not show clear button', () => {}); + it('should be readonly', () => {}); + it('should not be readonly', () => {}); + it('should enable text alignment', () => {}); + it('should show append button even be disabled', () => {}); + it('should has title', () => {}); + it('should has type', () => {}); + it('should has placeholder', () => {}); + it('should has min length', () => {}); + it('should has max length', () => {}); + it('should has tab index', () => {}); }); + + describe('render', () => {}); + + describe('methods', () => {}); + + describe('events', () => {}); + + describe('behaviors', () => {}); }); -- Gitee