File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -7,16 +7,20 @@ expect.extend(toHaveNoViolations);
77const originalError = console . error ;
88beforeAll ( ( ) => {
99 console . error = ( ...args ) => {
10- // Check if any of the arguments contains the floating-ui act warning
11- const hasFloatingActWarning = args . some (
12- ( arg ) =>
13- typeof arg === "string" &&
14- arg . includes (
15- "An update to withFloating(PopperComponent) inside a test was not wrapped in act" ,
16- ) ,
17- ) ;
10+ // Check the first argument ( the error message)
11+ const firstArg = args [ 0 ] ;
12+ const firstArgStr =
13+ typeof firstArg === "string"
14+ ? firstArg
15+ : firstArg instanceof Error
16+ ? firstArg . message
17+ : String ( firstArg ) ;
1818
19- if ( hasFloatingActWarning ) {
19+ // Suppress floating-ui act warnings
20+ if (
21+ firstArgStr . includes ( "An update to withFloating(PopperComponent)" ) &&
22+ firstArgStr . includes ( "inside a test was not wrapped in act" )
23+ ) {
2024 return ;
2125 }
2226
You can’t perform that action at this time.
0 commit comments