99
1010import type Store from 'react-devtools-shared/src/devtools/store' ;
1111
12+ import { getVersionedRenderImplementation } from './utils' ;
13+
1214describe ( 'profiling charts' , ( ) => {
1315 let React ;
1416 let Scheduler ;
15- let legacyRender ;
1617 let store : Store ;
1718 let utils ;
1819
1920 beforeEach ( ( ) => {
2021 utils = require ( './utils' ) ;
2122 utils . beforeEachProfiling ( ) ;
2223
23- legacyRender = utils . legacyRender ;
24-
2524 store = global . store ;
2625 store . collapseNodesByDefault = false ;
2726 store . recordChangeDescriptions = true ;
@@ -30,6 +29,8 @@ describe('profiling charts', () => {
3029 Scheduler = require ( 'scheduler' ) ;
3130 } ) ;
3231
32+ const { render} = getVersionedRenderImplementation ( ) ;
33+
3334 function getFlamegraphChartData ( rootID , commitIndex ) {
3435 const commitTree = store . profilerStore . profilingCache . getCommitTree ( {
3536 commitIndex,
@@ -78,11 +79,9 @@ describe('profiling charts', () => {
7879 return null ;
7980 } ) ;
8081
81- const container = document . createElement ( 'div' ) ;
82-
8382 utils . act ( ( ) => store . profilerStore . startProfiling ( ) ) ;
8483
85- utils . act ( ( ) => legacyRender ( < Parent /> , container ) ) ;
84+ utils . act ( ( ) => render ( < Parent /> ) ) ;
8685 expect ( store ) . toMatchInlineSnapshot ( `
8786 [root]
8887 ▾ <Parent>
@@ -91,7 +90,7 @@ describe('profiling charts', () => {
9190 <Child key="third"> [Memo]
9291 ` ) ;
9392
94- utils . act ( ( ) => legacyRender ( < Parent /> , container ) ) ;
93+ utils . act ( ( ) => render ( < Parent /> ) ) ;
9594 expect ( store ) . toMatchInlineSnapshot ( `
9695 [root]
9796 ▾ <Parent>
@@ -228,11 +227,9 @@ describe('profiling charts', () => {
228227 return null ;
229228 } ) ;
230229
231- const container = document . createElement ( 'div' ) ;
232-
233230 utils . act ( ( ) => store . profilerStore . startProfiling ( ) ) ;
234231
235- utils . act ( ( ) => legacyRender ( < Parent /> , container ) ) ;
232+ utils . act ( ( ) => render ( < Parent /> ) ) ;
236233 expect ( store ) . toMatchInlineSnapshot ( `
237234 [root]
238235 ▾ <Parent>
@@ -241,7 +238,7 @@ describe('profiling charts', () => {
241238 <Child key="third"> [Memo]
242239 ` ) ;
243240
244- utils . act ( ( ) => legacyRender ( < Parent /> , container ) ) ;
241+ utils . act ( ( ) => render ( < Parent /> ) ) ;
245242 expect ( store ) . toMatchInlineSnapshot ( `
246243 [root]
247244 ▾ <Parent>
0 commit comments