From e6cc0009c3b8419191670b658a13024657dbdb6d Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Mon, 12 Oct 2020 20:39:51 +0800 Subject: [PATCH 01/11] feat: Input.Textarea support size props (#27110) * feat: Input.Textarea add size props * update snapshot * update snapshot * add case * fix code --- .../__snapshots__/components.test.js.snap | 2 +- components/config-provider/demo/size.md | 3 ++ components/input/TextArea.tsx | 52 +++++++++++-------- .../__snapshots__/textarea.test.js.snap | 10 ++++ components/input/__tests__/textarea.test.js | 6 +++ 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/components/config-provider/__tests__/__snapshots__/components.test.js.snap b/components/config-provider/__tests__/__snapshots__/components.test.js.snap index f302029f1a..ef2ea0ddbd 100644 --- a/components/config-provider/__tests__/__snapshots__/components.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/components.test.js.snap @@ -14628,7 +14628,7 @@ exports[`ConfigProvider components Input configProvider componentSize large 1`] class="config-input-textarea" > @@ -49,7 +49,7 @@ exports[`TextArea allowClear should change type when click 2`] = ` /> @@ -84,7 +84,7 @@ exports[`TextArea allowClear should not show icon if defaultValue is undefined, /> @@ -119,7 +119,7 @@ exports[`TextArea allowClear should not show icon if defaultValue is undefined, /> @@ -154,7 +154,7 @@ exports[`TextArea allowClear should not show icon if defaultValue is undefined, /> @@ -189,7 +189,7 @@ exports[`TextArea allowClear should not show icon if value is undefined, null or /> @@ -224,7 +224,7 @@ exports[`TextArea allowClear should not show icon if value is undefined, null or /> @@ -259,7 +259,7 @@ exports[`TextArea allowClear should not show icon if value is undefined, null or /> diff --git a/components/input/__tests__/textarea.test.js b/components/input/__tests__/textarea.test.js index 491257abc2..1492c636f5 100644 --- a/components/input/__tests__/textarea.test.js +++ b/components/input/__tests__/textarea.test.js @@ -153,7 +153,7 @@ describe('TextArea allowClear', () => { wrapper.find('textarea').simulate('change', { target: { value: '111' } }); expect(wrapper.find('textarea').getDOMNode().value).toEqual('111'); expect(wrapper.render()).toMatchSnapshot(); - wrapper.find('.ant-input-textarea-clear-icon').at(0).simulate('click'); + wrapper.find('.ant-input-clear-icon').at(0).simulate('click'); expect(wrapper.render()).toMatchSnapshot(); expect(wrapper.find('textarea').getDOMNode().value).toEqual(''); }); @@ -162,7 +162,7 @@ describe('TextArea allowClear', () => { const wrappers = [null, undefined, ''].map(val => mount(