Skip to content

Commit 3d3706b

Browse files
committed
fix test
1 parent 5f64b5b commit 3d3706b

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

packages/react-dom/src/__tests__/ReactLegacyCompositeComponent-test.js

+18-1
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,13 @@ describe('ReactLegacyCompositeComponent', () => {
121121
assertConsoleErrorDev([
122122
'Child uses the legacy childContextTypes API which will soon be removed. ' +
123123
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
124+
(gate('enableOwnerStacks') ? '' : ' in Child (at **)\n') +
124125
' in Parent (at **)',
125126
'Grandchild uses the legacy contextTypes API which will soon be removed. ' +
126127
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
128+
(gate('enableOwnerStacks')
129+
? ''
130+
: ' in Grandchild (at **)\n' + ' in Child (at **)\n') +
127131
' in Parent (at **)',
128132
]);
129133
expect(findDOMNode(component).innerHTML).toBe('bar');
@@ -196,7 +200,10 @@ describe('ReactLegacyCompositeComponent', () => {
196200
' in Parent (at **)',
197201
'Child uses the legacy contextTypes API which will soon be removed. ' +
198202
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
199-
' in Child (at **)',
203+
' in Child (at **)' +
204+
(gate('enableOwnerStacks')
205+
? ''
206+
: '\n in Middle (at **)' + '\n in Parent (at **)'),
200207
]);
201208

202209
await act(() => {
@@ -261,9 +268,15 @@ describe('ReactLegacyCompositeComponent', () => {
261268
assertConsoleErrorDev([
262269
'Parent uses the legacy childContextTypes API which will soon be removed. ' +
263270
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
271+
(gate('enableOwnerStacks') ? '' : ' in Parent (at **)\n') +
264272
' in Wrapper (at **)',
265273
'Child uses the legacy contextTypes API which will soon be removed. ' +
266274
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
275+
(gate('enableOwnerStacks')
276+
? ''
277+
: ' in Child (at **)\n' +
278+
' in div (at **)\n' +
279+
' in Parent (at **)\n') +
267280
' in Wrapper (at **)',
268281
]);
269282

@@ -348,12 +361,15 @@ describe('ReactLegacyCompositeComponent', () => {
348361
' in Parent (at **)',
349362
'Child uses the legacy childContextTypes API which will soon be removed. ' +
350363
'Use React.createContext() instead. (https://react.dev/link/legacy-context)\n' +
364+
(gate('enableOwnerStacks') ? '' : ' in Child (at **)\n') +
351365
' in Parent (at **)',
352366
'Child uses the legacy contextTypes API which will soon be removed. ' +
353367
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
368+
(gate('enableOwnerStacks') ? '' : ' in Child (at **)\n') +
354369
' in Parent (at **)',
355370
'Grandchild uses the legacy contextTypes API which will soon be removed. ' +
356371
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
372+
(gate('enableOwnerStacks') ? '' : ' in Grandchild (at **)\n') +
357373
' in Child (at **)\n' +
358374
' in Parent (at **)',
359375
]);
@@ -425,6 +441,7 @@ describe('ReactLegacyCompositeComponent', () => {
425441
assertConsoleErrorDev([
426442
'Child uses the legacy contextTypes API which will soon be removed. ' +
427443
'Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)\n' +
444+
(gate('enableOwnerStacks') ? '' : ' in Child (at **)\n') +
428445
' in Parent (at **)',
429446
]);
430447

0 commit comments

Comments
 (0)