diff --git a/components/input/__tests__/__snapshots__/index.test.js.snap b/components/input/__tests__/__snapshots__/index.test.js.snap index 52a1e4d119..966b96d70e 100644 --- a/components/input/__tests__/__snapshots__/index.test.js.snap +++ b/components/input/__tests__/__snapshots__/index.test.js.snap @@ -18,6 +18,226 @@ exports[`Input should support maxLength 1`] = ` `; +exports[`Input.Password should change type when click 1`] = ` + + + } + type="password" + > + + + + + + + + + + + + + + +`; + +exports[`Input.Password should change type when click 2`] = ` + + + } + type="text" + > + + + + + + + + + + + + + + +`; + +exports[`Input.Password should change type when click 3`] = ` + + + } + type="password" + > + + + + + + + + + + + + + + +`; + exports[`Input.Search should support suffix 1`] = ` { describe('Input.Password', () => { it('should change type when click', () => { const wrapper = mount(); - - expect(wrapper.find('.ant-input').prop('type')).toBe('password'); - + wrapper.find('input').simulate('change', { target: { value: '111' } }); + expect(wrapper).toMatchSnapshot(); wrapper.find('.ant-input-password-icon').at(0).simulate('click'); - expect(wrapper.find('.ant-input').prop('type')).toBe('text'); - + expect(wrapper).toMatchSnapshot(); wrapper.find('.ant-input-password-icon').at(0).simulate('click'); - expect(wrapper.find('.ant-input').prop('type')).toBe('password'); + expect(wrapper).toMatchSnapshot(); }); });