From 0604a0959018a2c2339aa9ce6a53b2cf380413a5 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 22 Oct 2019 21:33:19 +0800 Subject: [PATCH] :white_check_mark: update demo and test case --- components/input/__tests__/Search.test.js | 12 + .../__snapshots__/Search.test.js.snap | 247 ++++++++++++++++++ .../__tests__/__snapshots__/demo.test.js.snap | 109 ++------ .../__snapshots__/index.test.js.snap | 3 +- components/input/demo/search-input-loading.md | 10 - 5 files changed, 288 insertions(+), 93 deletions(-) diff --git a/components/input/__tests__/Search.test.js b/components/input/__tests__/Search.test.js index 705506cbf1..14aff06123 100644 --- a/components/input/__tests__/Search.test.js +++ b/components/input/__tests__/Search.test.js @@ -166,4 +166,16 @@ describe('Input.Search', () => { expect(wrapper.render()).toMatchSnapshot(); expect(wrapperWithEnterButton.render()).toMatchSnapshot(); }); + + it('should support addonAfter and suffix for loading', () => { + const wrapper = mount(); + const wrapperWithEnterButton = mount(); + expect(wrapper.render()).toMatchSnapshot(); + expect(wrapperWithEnterButton.render()).toMatchSnapshot(); + }) + + it('should support invalid addonAfter and suffix', () => { + const wrapper = mount(); + expect(wrapper.render()).toMatchSnapshot(); + }) }); diff --git a/components/input/__tests__/__snapshots__/Search.test.js.snap b/components/input/__tests__/__snapshots__/Search.test.js.snap index a5ec6ef6d0..0d0114f6f6 100644 --- a/components/input/__tests__/__snapshots__/Search.test.js.snap +++ b/components/input/__tests__/__snapshots__/Search.test.js.snap @@ -98,6 +98,109 @@ exports[`Input.Search should support addonAfter 2`] = ` `; +exports[`Input.Search should support addonAfter and suffix for loading 1`] = ` + + + + + + suffix + + + + + + + addonAfter + + + +`; + +exports[`Input.Search should support addonAfter and suffix for loading 2`] = ` + + + + + + suffix + + + + + addonAfter + + + +`; + exports[`Input.Search should support custom Button 1`] = ` `; +exports[`Input.Search should support invalid addonAfter and suffix 1`] = ` + + + + + + + + + + + + + +`; + +exports[`Input.Search should support invalid addonAfter and suffix for loading 1`] = ` + + + + + + + + + + + + + +`; + +exports[`Input.Search should support invalid addonAfter and suffix for loading 2`] = ` + + + + + + + + + + + +`; + exports[`Input.Search should support loading 1`] = ` Ant Design +
+ + + +


- - - - suffix - - - - - -
-
@@ -1926,51 +1918,6 @@ exports[`renders ./components/input/demo/search-input-loading.md correctly 1`] =
-
-
- - - - - - addonAfter - - - `; diff --git a/components/input/__tests__/__snapshots__/index.test.js.snap b/components/input/__tests__/__snapshots__/index.test.js.snap index c9bfa9f3dc..81618423cd 100644 --- a/components/input/__tests__/__snapshots__/index.test.js.snap +++ b/components/input/__tests__/__snapshots__/index.test.js.snap @@ -258,7 +258,7 @@ exports[`Input.Search should support suffix 1`] = ` prefixCls="ant-input" suffix={ Array [ - "suffix", + null, - suffix

- -
-
-
-
- , mountNode, );