File tree 1 file changed +9
-5
lines changed
packages/@react-spectrum/labeledvalue/test
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -292,14 +292,18 @@ describe('LabeledValue', function () {
292
292
} ) ;
293
293
294
294
it ( 'throws when an editable value is provided' , async function ( ) {
295
- await waitFor ( ( ) => {
296
- expect ( ( ) => render (
295
+ const consoleErrorSpy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } ) ;
296
+ try {
297
+ render (
297
298
< LabeledValue
298
- data-testid = "test-id"
299
299
label = "Field label"
300
300
value = { < input /> } />
301
- ) ) . toThrowError ( 'LabeledValue cannot contain an editable value.' ) ;
302
- } ) ;
301
+ ) ;
302
+ } catch ( e ) {
303
+ console . log ( e . message ) ;
304
+ expect ( e . message ) . toEqual ( "LabeledValue cannot contain an editable value." ) ;
305
+ expect ( consoleErrorSpy ) . toHaveBeenCalled ( ) ;
306
+ }
303
307
} ) ;
304
308
305
309
it ( 'attaches a user provided ref to the outer div' , function ( ) {
You can’t perform that action at this time.
0 commit comments