From 9bc26c80df44aaabf1592c0e68e8f6fa60efa6b6 Mon Sep 17 00:00:00 2001 From: eps1lon Date: Fri, 15 Mar 2024 14:38:18 +0100 Subject: [PATCH] Remove excess `ms` prop from Suspense tests These tests now use the built-in cache and the prop was ignored for a while now so I removed them to avoid confusion when reading tests. --- .../__tests__/ReactSuspense-test.internal.js | 44 +++++------ .../ReactSuspenseEffectsSemantics-test.js | 76 +++++++++---------- .../__tests__/ReactSuspenseFallback-test.js | 12 +-- .../ReactSuspenseWithNoopRenderer-test.js | 12 +-- .../src/__tests__/ReactTransition-test.js | 2 +- 5 files changed, 69 insertions(+), 77 deletions(-) diff --git a/packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js b/packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js index 6c5a6c73a5711..8f4664a5325a3 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspense-test.internal.js @@ -107,7 +107,7 @@ describe('ReactSuspense', () => { }> {renderBar ? ( - + ) : null} @@ -153,10 +153,10 @@ describe('ReactSuspense', () => { root.render( <> }> - + }> - + , ); @@ -258,9 +258,9 @@ describe('ReactSuspense', () => { Scheduler.log('Foo'); return ( }> - + }> - + ); @@ -294,9 +294,9 @@ describe('ReactSuspense', () => { Scheduler.log('Foo'); return ( }> - + }> - + ); @@ -346,7 +346,7 @@ describe('ReactSuspense', () => { <> }> - {shouldSuspend ? : null} + {shouldSuspend ? : null} @@ -627,7 +627,7 @@ describe('ReactSuspense', () => { return ( }> - {show && } + {show && } ); } @@ -722,7 +722,7 @@ describe('ReactSuspense', () => { return ( }> - + ); @@ -776,7 +776,7 @@ describe('ReactSuspense', () => { return ( }> - + ); } @@ -822,7 +822,7 @@ describe('ReactSuspense', () => { - + @@ -872,7 +872,7 @@ describe('ReactSuspense', () => { function App({text}) { return ( }> - + ); } @@ -902,7 +902,7 @@ describe('ReactSuspense', () => { function App({text}) { return ( }> - + ); } @@ -920,7 +920,7 @@ describe('ReactSuspense', () => { state = {step: 1}; render() { instance = this; - return ; + return ; } } @@ -976,9 +976,9 @@ describe('ReactSuspense', () => { function App(props) { return ( }> - - - + + + ); } @@ -1019,7 +1019,7 @@ describe('ReactSuspense', () => { return ( }> - + ); @@ -1087,9 +1087,9 @@ describe('ReactSuspense', () => { function App() { return ( }> - - - + + + ); } diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseEffectsSemantics-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseEffectsSemantics-test.js index 19771d9757bf2..85a983a9161dd 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseEffectsSemantics-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseEffectsSemantics-test.js @@ -258,7 +258,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( - + , ); }); @@ -376,7 +376,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.renderLegacySyncRoot( - + , ); }); @@ -503,7 +503,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.renderLegacySyncRoot( - + , ); }); @@ -633,7 +633,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( - + , ); await waitFor([ @@ -773,7 +773,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( - + , ); @@ -885,7 +885,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( - + , ); await waitFor([ @@ -999,7 +999,7 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( - + , ); await waitFor([ @@ -1097,7 +1097,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { ReactNoop.render( - } />, + } />, ); }); assertLog([ @@ -1122,8 +1122,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( } - innerChildren={} + outerChildren={} + innerChildren={} />, ); }); @@ -1164,8 +1164,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( } - innerChildren={} + outerChildren={} + innerChildren={} />, ); }); @@ -1236,8 +1236,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( } - innerChildren={} + outerChildren={} + innerChildren={} />, ); }); @@ -1325,7 +1325,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { ReactNoop.render( - } />, + } />, ); }); assertLog([ @@ -1350,8 +1350,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( } - innerChildren={} + outerChildren={} + innerChildren={} />, ); }); @@ -1448,7 +1448,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the outer shell await act(async () => { ReactNoop.render( - } />, + } />, ); await waitFor([ 'Text:Inside render', @@ -1478,8 +1478,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( } - outerChildren={} + fallbackChildren={} + outerChildren={} />, ); await waitFor([ @@ -1577,8 +1577,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(() => { ReactNoop.render( } - fallbackChildren={} + outerChildren={} + fallbackChildren={} />, ); }); @@ -1807,7 +1807,7 @@ describe('ReactSuspenseEffectsSemantics', () => { ReactNoop.render( }> - + , ); @@ -1941,7 +1941,7 @@ describe('ReactSuspenseEffectsSemantics', () => { ReactNoop.render( }> - + , ); @@ -2050,7 +2050,7 @@ describe('ReactSuspenseEffectsSemantics', () => { ReactNoop.render( }> - + , ); @@ -2184,7 +2184,7 @@ describe('ReactSuspenseEffectsSemantics', () => { ReactNoop.render( }> - + , ); @@ -2276,8 +2276,8 @@ describe('ReactSuspenseEffectsSemantics', () => { await act(async () => { ReactNoop.render( - - + + , ); await waitFor([ @@ -2581,7 +2581,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { ReactNoop.renderLegacySyncRoot( - } />, + } />, ); }); await advanceTimers(1000); @@ -2661,9 +2661,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { - ReactNoop.render( - } />, - ); + ReactNoop.render(} />); }); await advanceTimers(1000); assertLog([ @@ -2764,9 +2762,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { - ReactNoop.render( - } />, - ); + ReactNoop.render(} />); }); await advanceTimers(1000); assertLog([ @@ -2863,9 +2859,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { - ReactNoop.render( - } />, - ); + ReactNoop.render(} />); }); await advanceTimers(1000); assertLog([ @@ -2967,9 +2961,7 @@ describe('ReactSuspenseEffectsSemantics', () => { // Suspend the inner Suspense subtree (only inner effects should be destroyed) await act(() => { - ReactNoop.render( - } />, - ); + ReactNoop.render(} />); }); await advanceTimers(1000); assertLog([ @@ -3078,7 +3070,7 @@ describe('ReactSuspenseEffectsSemantics', () => { ReactNoop.render( }> - + , ); diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseFallback-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseFallback-test.js index 8dcf5fda13695..d465c959ce1d0 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseFallback-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseFallback-test.js @@ -135,7 +135,7 @@ describe('ReactSuspenseFallback', () => { it('suspends and shows fallback', async () => { ReactNoop.render( }> - + , ); @@ -147,7 +147,7 @@ describe('ReactSuspenseFallback', () => { it('suspends and shows null fallback', async () => { ReactNoop.render( - + , ); @@ -162,7 +162,7 @@ describe('ReactSuspenseFallback', () => { it('suspends and shows undefined fallback', async () => { ReactNoop.render( - + , ); @@ -178,7 +178,7 @@ describe('ReactSuspenseFallback', () => { ReactNoop.render( }> }> - + , ); @@ -192,7 +192,7 @@ describe('ReactSuspenseFallback', () => { ReactNoop.render( }> - + , ); @@ -209,7 +209,7 @@ describe('ReactSuspenseFallback', () => { ReactNoop.render( }> - + , ); diff --git a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js index 4d1eed5456614..f52c33887c257 100644 --- a/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js +++ b/packages/react-reconciler/src/__tests__/ReactSuspenseWithNoopRenderer-test.js @@ -208,7 +208,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { <> }> - + @@ -422,7 +422,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { }> {renderContent ? ( - + ) : null} @@ -619,7 +619,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { } return ( - + ); } @@ -715,9 +715,9 @@ describe('ReactSuspenseWithNoopRenderer', () => { }> - + }> - + , @@ -2821,7 +2821,7 @@ describe('ReactSuspenseWithNoopRenderer', () => { }> - {showContent ? : null} + {showContent ? : null} ); diff --git a/packages/react-reconciler/src/__tests__/ReactTransition-test.js b/packages/react-reconciler/src/__tests__/ReactTransition-test.js index e5c69665f31c2..5be3278b52574 100644 --- a/packages/react-reconciler/src/__tests__/ReactTransition-test.js +++ b/packages/react-reconciler/src/__tests__/ReactTransition-test.js @@ -719,7 +719,7 @@ describe('ReactTransition', () => { <> }> - {shouldSuspend ? : null} + {shouldSuspend ? : null}