@@ -4,7 +4,6 @@ import Input from '..';
4
4
// import Form from '../../form';
5
5
import focusTest from '../../../tests/shared/focusTest' ;
6
6
import { WifiOutlined , SyncOutlined } from '@ant-design/icons-vue' ;
7
- import { ref } from 'vue' ;
8
7
9
8
const { TextArea, Password } = Input ;
10
9
@@ -165,23 +164,19 @@ describe('Input.Password', () => {
165
164
} , 100 ) ;
166
165
} ) ;
167
166
168
- it ( 'should support visibilityToggle (boolean)' , async ( ) => {
167
+ it ( 'should support visibilityToggl (boolean)' , async ( ) => {
169
168
const wrapper = mount ( Input . Password , { props : { visibilityToggle : false } , sync : false } ) ;
170
169
await asyncExpect ( ( ) => {
171
170
expect ( wrapper . findAll ( '.anticon-eye' ) . length ) . toBe ( 0 ) ;
172
171
} , 100 ) ;
173
172
} ) ;
174
173
175
- it ( 'should support visibilityToggle ' , async ( ) => {
174
+ it ( 'should support visible and update:visible ' , async ( ) => {
176
175
const cbMock = jest . fn ( ) ;
177
- const wrapper = mount ( Input . Password , {
178
- props : {
179
- visibilityToggle : {
180
- visible : ref ( true ) ,
181
- onVisibleChange : cbMock ,
182
- } ,
176
+ const wrapper = mount ( {
177
+ render ( ) {
178
+ return < Password { ...{ 'onUpdate:visible' : cbMock } } visible = "false" > </ Password > ;
183
179
} ,
184
- sync : false ,
185
180
} ) ;
186
181
187
182
await asyncExpect ( ( ) => {
@@ -192,8 +187,6 @@ describe('Input.Password', () => {
192
187
wrapper . find ( '.anticon-eye' ) . trigger ( 'click' ) ;
193
188
} , 100 ) ;
194
189
195
- await asyncExpect ( ( ) => {
196
- expect ( cbMock ) . toHaveBeenCalledWith ( false ) ;
197
- } , 100 ) ;
190
+ expect ( cbMock ) . toHaveBeenCalledWith ( false ) ;
198
191
} ) ;
199
192
} ) ;
0 commit comments