mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
test: update test case
This commit is contained in:
parent
1638a629f4
commit
bcefe82ee4
@ -241,110 +241,6 @@ exports[`Input.Password should change type when click 3`] = `
|
||||
</Password>
|
||||
`;
|
||||
|
||||
exports[`Input.Password visibilityToggle should work 1`] = `
|
||||
<Password
|
||||
action="click"
|
||||
inputPrefixCls="ant-input"
|
||||
prefixCls="ant-input-password"
|
||||
visibilityToggle={false}
|
||||
>
|
||||
<Input
|
||||
action="click"
|
||||
className="ant-input-password"
|
||||
disabled={false}
|
||||
prefixCls="ant-input"
|
||||
suffix={false}
|
||||
type="password"
|
||||
>
|
||||
<span
|
||||
className="ant-input-password ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
action="click"
|
||||
className="ant-input"
|
||||
disabled={false}
|
||||
onKeyDown={[Function]}
|
||||
style={null}
|
||||
type="password"
|
||||
/>
|
||||
</span>
|
||||
</Input>
|
||||
</Password>
|
||||
`;
|
||||
|
||||
exports[`Input.Password visibilityToggle should work 2`] = `
|
||||
<Password
|
||||
action="click"
|
||||
inputPrefixCls="ant-input"
|
||||
prefixCls="ant-input-password"
|
||||
visibilityToggle={true}
|
||||
>
|
||||
<Input
|
||||
action="click"
|
||||
className="ant-input-password"
|
||||
disabled={false}
|
||||
prefixCls="ant-input"
|
||||
suffix={
|
||||
<Icon
|
||||
className="ant-input-password-icon"
|
||||
onClick={[Function]}
|
||||
type="eye"
|
||||
/>
|
||||
}
|
||||
type="password"
|
||||
>
|
||||
<span
|
||||
className="ant-input-password ant-input-affix-wrapper"
|
||||
>
|
||||
<input
|
||||
action="click"
|
||||
className="ant-input"
|
||||
disabled={false}
|
||||
onKeyDown={[Function]}
|
||||
style={null}
|
||||
type="password"
|
||||
/>
|
||||
<span
|
||||
className="ant-input-suffix"
|
||||
>
|
||||
<Icon
|
||||
className="ant-input-password-icon"
|
||||
key="passwordIcon"
|
||||
onClick={[Function]}
|
||||
type="eye"
|
||||
>
|
||||
<i
|
||||
className="anticon anticon-eye ant-input-password-icon"
|
||||
onClick={[Function]}
|
||||
>
|
||||
<IconReact
|
||||
className=""
|
||||
type="eye-o"
|
||||
>
|
||||
<svg
|
||||
aria-hidden="true"
|
||||
className=""
|
||||
data-icon="eye"
|
||||
fill="currentColor"
|
||||
height="1em"
|
||||
key="svg-eye"
|
||||
viewBox="64 64 896 896"
|
||||
width="1em"
|
||||
>
|
||||
<path
|
||||
d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z"
|
||||
key="svg-eye-svg-0"
|
||||
/>
|
||||
</svg>
|
||||
</IconReact>
|
||||
</i>
|
||||
</Icon>
|
||||
</span>
|
||||
</span>
|
||||
</Input>
|
||||
</Password>
|
||||
`;
|
||||
|
||||
exports[`Input.Search should support suffix 1`] = `
|
||||
<Search
|
||||
enterButton={false}
|
||||
|
@ -120,8 +120,8 @@ describe('Input.Password', () => {
|
||||
|
||||
it('visibilityToggle should work', () => {
|
||||
const wrapper = mount(<Input.Password visibilityToggle={false} />);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(wrapper.find('.anticon-eye').length).toBe(0);
|
||||
wrapper.setProps({ visibilityToggle: true });
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
expect(wrapper.find('.anticon-eye').length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user