@@ -177,7 +177,6 @@ describe('useComboBoxState tests', function () {
177
177
expect ( result . current . selectionManager . selectedKeys ) . toContain ( '0' ) ;
178
178
expect ( result . current . selectionManager . selectedKeys ) . not . toContain ( '1' ) ;
179
179
180
- act ( ( ) => { result . current . open ( ) ; } ) ;
181
180
act ( ( ) => result . current . selectionManager . replaceSelection ( '1' ) ) ;
182
181
expect ( result . current . selectionManager . selectedKeys ) . toContain ( '0' ) ;
183
182
expect ( result . current . selectionManager . selectedKeys ) . not . toContain ( '1' ) ;
@@ -191,34 +190,22 @@ describe('useComboBoxState tests', function () {
191
190
expect ( result . current . selectionManager . selectedKeys ) . toContain ( '0' ) ;
192
191
expect ( result . current . selectionManager . selectedKeys ) . not . toContain ( '1' ) ;
193
192
194
- act ( ( ) => { result . current . open ( ) ; } ) ;
195
193
act ( ( ) => result . current . selectionManager . replaceSelection ( '1' ) ) ;
196
194
expect ( result . current . selectionManager . selectedKeys ) . toContain ( '1' ) ;
197
195
expect ( result . current . selectionManager . selectedKeys ) . not . toContain ( '0' ) ;
198
196
expect ( onSelectionChange ) . toHaveBeenCalledWith ( '1' ) ;
199
197
} ) ;
200
198
201
- it ( 'supports default no selection' , function ( ) {
199
+ it ( 'supports sdefault no selection' , function ( ) {
202
200
let initialProps = { ...defaultProps } ;
203
201
let { result} = renderHook ( ( props ) => useComboBoxState ( props ) , { initialProps} ) ;
204
202
expect ( result . current . selectionManager . selectionMode ) . toBe ( 'single' ) ;
205
203
expect ( result . current . selectionManager . selectedKeys . size ) . toBe ( 0 ) ;
206
204
207
- act ( ( ) => { result . current . open ( ) ; } ) ;
208
205
act ( ( ) => result . current . selectionManager . replaceSelection ( '1' ) ) ;
209
206
expect ( result . current . selectionManager . selectedKeys ) . toContain ( '1' ) ;
210
207
expect ( result . current . selectionManager . selectedKeys ) . not . toContain ( '0' ) ;
211
208
expect ( onSelectionChange ) . toHaveBeenCalledWith ( '1' ) ;
212
209
} ) ;
213
-
214
- it ( 'won\'t perform replace a selection if the combobox is closed' , function ( ) {
215
- // This case covers if a option in the menu is clicked while the menu is closing
216
- let initialProps = { ...defaultProps } ;
217
- let { result} = renderHook ( ( props ) => useComboBoxState ( props ) , { initialProps} ) ;
218
-
219
- act ( ( ) => result . current . selectionManager . replaceSelection ( '1' ) ) ;
220
- expect ( result . current . selectionManager . selectedKeys . size ) . toEqual ( 0 ) ;
221
- expect ( onSelectionChange ) . toHaveBeenCalledTimes ( 0 ) ;
222
- } ) ;
223
210
} ) ;
224
211
} ) ;
0 commit comments