File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
packages/react-scripts/fixtures/kitchensink/template/src/features/webpack Expand file tree Collapse file tree 1 file changed +4
-9
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- import { flushSync } from 'react-dom' ;
1211
1312describe ( 'svg component' , ( ) => {
1413 it ( 'renders without crashing' , async ( ) => {
1514 const div = document . createElement ( 'div' ) ;
16- flushSync ( ( ) => {
17- ReactDOMClient . createRoot ( div ) . render ( < SvgComponent /> ) ;
18- } ) ;
15+ ReactDOMClient . createRoot ( div ) . render ( < SvgComponent /> ) ;
1916 expect ( div . textContent ) . toBe ( 'logo.svg' ) ;
2017 } ) ;
2118
2219 it ( 'svg root element equals the passed ref' , async ( ) => {
2320 const div = document . createElement ( 'div' ) ;
2421 const someRef = React . createRef ( ) ;
25- flushSync ( ( ) => {
26- ReactDOMClient . createRoot ( div ) . render (
27- < SvgComponentWithRef ref = { someRef } />
28- ) ;
29- } ) ;
22+ ReactDOMClient . createRoot ( div ) . render (
23+ < SvgComponentWithRef ref = { someRef } />
24+ ) ;
3025 const svgElement = div . getElementsByTagName ( 'svg' ) ;
3126 expect ( svgElement ) . toHaveLength ( 1 ) ;
3227 expect ( svgElement [ 0 ] ) . toBe ( someRef . current ) ;
You can’t perform that action at this time.
0 commit comments