File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/react-scripts/fixtures/kitchensink/template/src/features/webpack Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 88import * as React from 'react' ;
99import SvgComponent , { SvgComponentWithRef } from './SvgComponent' ;
1010import ReactDOMClient from 'react-dom/client' ;
11-
12- global . IS_REACT_ACT_ENVIRONMENT = true ;
11+ import { flushSync } from 'react-dom' ;
1312
1413describe ( 'svg component' , ( ) => {
15- it ( 'renders without crashing' , ( ) => {
14+ it ( 'renders without crashing' , async ( ) => {
1615 const div = document . createElement ( 'div' ) ;
17- ReactDOMClient . createRoot ( div ) . render ( < SvgComponent /> ) ;
16+ flushSync ( ( ) => {
17+ ReactDOMClient . createRoot ( div ) . render ( < SvgComponent /> ) ;
18+ } ) ;
1819 expect ( div . textContent ) . toBe ( 'logo.svg' ) ;
1920 } ) ;
2021
2122 it ( 'svg root element equals the passed ref' , async ( ) => {
2223 const div = document . createElement ( 'div' ) ;
2324 const someRef = React . createRef ( ) ;
24- // eslint-disable-next-line testing-library/no-unnecessary-act
25- await React . act ( async ( ) => {
25+ flushSync ( ( ) => {
2626 ReactDOMClient . createRoot ( div ) . render (
2727 < SvgComponentWithRef ref = { someRef } />
2828 ) ;
You can’t perform that action at this time.
0 commit comments