From 8b54f40f9802bcc276d10b81eaac11d0ce4a4590 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Thu, 6 Jun 2024 18:31:49 -0400 Subject: [PATCH] Update snapshot tests The warning now is counted on the Child instead of the parent. However, this won't be released in 19.0 so I only test this in whatever the next version is. --- .../react-devtools-shared/src/__tests__/store-test.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/react-devtools-shared/src/__tests__/store-test.js b/packages/react-devtools-shared/src/__tests__/store-test.js index c6ce366df04b2..6e065cdc93906 100644 --- a/packages/react-devtools-shared/src/__tests__/store-test.js +++ b/packages/react-devtools-shared/src/__tests__/store-test.js @@ -1916,11 +1916,9 @@ describe('Store', () => { }); // In React 19, JSX warnings were moved into the renderer - https://github.com/facebook/react/pull/29088 - // When the error is emitted, the source fiber of this error is not yet mounted - // So DevTools can't connect the error and the fiber - // TODO(hoxyq): update RDT to keep track of such fibers - // @reactVersion >= 19.0 - it('from react get counted [React >= 19]', () => { + // The warning is moved to the Child instead of the Parent. + // @reactVersion >= 19.0.1 + it('from react get counted [React >= 19.0.1]', () => { function Example() { return []; } @@ -1936,9 +1934,10 @@ describe('Store', () => { ); expect(store).toMatchInlineSnapshot(` + ✕ 1, ⚠ 0 [root] ▾ - + ✕ `); });