@@ -17,6 +17,8 @@ let caches;
17
17
let seededCache ;
18
18
let ErrorBoundary ;
19
19
20
+ // TODO: These tests don't pass in persistent mode yet. Need to implement.
21
+
20
22
describe ( 'ReactSuspenseEffectsSemantics' , ( ) => {
21
23
beforeEach ( ( ) => {
22
24
jest . resetModules ( ) ;
@@ -565,6 +567,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
565
567
566
568
// @gate enableSuspenseLayoutEffectSemantics
567
569
// @gate enableCache
570
+ // @gate !persistent
568
571
it ( 'should be destroyed and recreated for function components' , async ( ) => {
569
572
function App ( { children = null } ) {
570
573
Scheduler . unstable_yieldValue ( 'App render' ) ;
@@ -694,6 +697,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
694
697
695
698
// @gate enableSuspenseLayoutEffectSemantics
696
699
// @gate enableCache
700
+ // @gate !persistent
697
701
it ( 'should be destroyed and recreated for class components' , async ( ) => {
698
702
class ClassText extends React . Component {
699
703
componentDidMount ( ) {
@@ -839,6 +843,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
839
843
840
844
// @gate enableSuspenseLayoutEffectSemantics
841
845
// @gate enableCache
846
+ // @gate !persistent
842
847
it ( 'should be destroyed and recreated when nested below host components' , async ( ) => {
843
848
function App ( { children = null } ) {
844
849
Scheduler . unstable_yieldValue ( 'App render' ) ;
@@ -949,6 +954,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
949
954
950
955
// @gate enableSuspenseLayoutEffectSemantics
951
956
// @gate enableCache
957
+ // @gate !persistent
952
958
it ( 'should be destroyed and recreated even if there is a bailout because of memoization' , async ( ) => {
953
959
const MemoizedText = React . memo ( Text , ( ) => true ) ;
954
960
@@ -1065,6 +1071,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1065
1071
1066
1072
// @gate enableSuspenseLayoutEffectSemantics
1067
1073
// @gate enableCache
1074
+ // @gate !persistent
1068
1075
it ( 'should respect nested suspense boundaries' , async ( ) => {
1069
1076
function App ( { innerChildren = null , outerChildren = null } ) {
1070
1077
return (
@@ -1288,6 +1295,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1288
1295
1289
1296
// @gate enableSuspenseLayoutEffectSemantics
1290
1297
// @gate enableCache
1298
+ // @gate !persistent
1291
1299
it ( 'should show nested host nodes if multiple boundaries resolve at the same time' , async ( ) => {
1292
1300
function App ( { innerChildren = null , outerChildren = null } ) {
1293
1301
return (
@@ -1398,6 +1406,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1398
1406
1399
1407
// @gate enableSuspenseLayoutEffectSemantics
1400
1408
// @gate enableCache
1409
+ // @gate !persistent
1401
1410
it ( 'should be cleaned up inside of a fallback that suspends' , async ( ) => {
1402
1411
function App ( { fallbackChildren = null , outerChildren = null } ) {
1403
1412
return (
@@ -1541,6 +1550,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1541
1550
1542
1551
// @gate enableSuspenseLayoutEffectSemantics
1543
1552
// @gate enableCache
1553
+ // @gate !persistent
1544
1554
it ( 'should be cleaned up inside of a fallback that suspends (alternate)' , async ( ) => {
1545
1555
function App ( { fallbackChildren = null , outerChildren = null } ) {
1546
1556
return (
@@ -1661,6 +1671,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1661
1671
1662
1672
// @gate enableSuspenseLayoutEffectSemantics
1663
1673
// @gate enableCache
1674
+ // @gate !persistent
1664
1675
it ( 'should be cleaned up deeper inside of a subtree that suspends' , async ( ) => {
1665
1676
function ConditionalSuspense ( { shouldSuspend} ) {
1666
1677
if ( shouldSuspend ) {
@@ -1744,6 +1755,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1744
1755
describe ( 'that throw errors' , ( ) => {
1745
1756
// @gate enableSuspenseLayoutEffectSemantics
1746
1757
// @gate enableCache
1758
+ // @gate !persistent
1747
1759
it ( 'are properly handled for componentDidMount' , async ( ) => {
1748
1760
let componentDidMountShouldThrow = false ;
1749
1761
@@ -1883,6 +1895,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1883
1895
1884
1896
// @gate enableSuspenseLayoutEffectSemantics
1885
1897
// @gate enableCache
1898
+ // @gate !persistent
1886
1899
it ( 'are properly handled for componentWillUnmount' , async ( ) => {
1887
1900
class ThrowsInWillUnmount extends React . Component {
1888
1901
componentDidMount ( ) {
@@ -1996,6 +2009,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
1996
2009
1997
2010
// @gate enableSuspenseLayoutEffectSemantics
1998
2011
// @gate enableCache
2012
+ // @gate !persistent
1999
2013
// @gate replayFailedUnitOfWorkWithInvokeGuardedCallback
2000
2014
it ( 'are properly handled for layout effect creation' , async ( ) => {
2001
2015
let useLayoutEffectShouldThrow = false ;
@@ -2136,6 +2150,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2136
2150
2137
2151
// @gate enableSuspenseLayoutEffectSemantics
2138
2152
// @gate enableCache
2153
+ // @gate !persistent
2139
2154
// @gate replayFailedUnitOfWorkWithInvokeGuardedCallback
2140
2155
it ( 'are properly handled for layout effect descruction' , async ( ) => {
2141
2156
function ThrowsInLayoutEffectDestroy ( ) {
@@ -2248,6 +2263,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2248
2263
2249
2264
// @gate enableSuspenseLayoutEffectSemantics
2250
2265
// @gate enableCache
2266
+ // @gate !persistent
2251
2267
it ( 'should be only destroy layout effects once if a tree suspends in multiple places' , async ( ) => {
2252
2268
class ClassText extends React . Component {
2253
2269
componentDidMount ( ) {
@@ -2387,6 +2403,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2387
2403
2388
2404
// @gate enableSuspenseLayoutEffectSemantics
2389
2405
// @gate enableCache
2406
+ // @gate !persistent
2390
2407
it ( 'should be only destroy layout effects once if a component suspends multiple times' , async ( ) => {
2391
2408
class ClassText extends React . Component {
2392
2409
componentDidMount ( ) {
@@ -2671,6 +2688,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2671
2688
2672
2689
// @gate enableSuspenseLayoutEffectSemantics
2673
2690
// @gate enableCache
2691
+ // @gate !persistent
2674
2692
it ( 'should be cleared and reset for host components' , async ( ) => {
2675
2693
function App ( { children} ) {
2676
2694
Scheduler . unstable_yieldValue ( `App render` ) ;
@@ -2768,6 +2786,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2768
2786
2769
2787
// @gate enableSuspenseLayoutEffectSemantics
2770
2788
// @gate enableCache
2789
+ // @gate !persistent
2771
2790
it ( 'should be cleared and reset for class components' , async ( ) => {
2772
2791
class ClassComponent extends React . Component {
2773
2792
render ( ) {
@@ -2869,6 +2888,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2869
2888
2870
2889
// @gate enableSuspenseLayoutEffectSemantics
2871
2890
// @gate enableCache
2891
+ // @gate !persistent
2872
2892
it ( 'should be cleared and reset for function components with useImperativeHandle' , async ( ) => {
2873
2893
const FunctionComponent = React . forwardRef ( ( props , ref ) => {
2874
2894
Scheduler . unstable_yieldValue ( 'FunctionComponent render' ) ;
@@ -2974,6 +2994,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
2974
2994
2975
2995
// @gate enableSuspenseLayoutEffectSemantics
2976
2996
// @gate enableCache
2997
+ // @gate !persistent
2977
2998
it ( 'should not reset for user-managed values' , async ( ) => {
2978
2999
function RefChecker ( { forwardedRef} ) {
2979
3000
Scheduler . unstable_yieldValue ( `RefChecker render` ) ;
@@ -3072,6 +3093,7 @@ describe('ReactSuspenseEffectsSemantics', () => {
3072
3093
describe ( 'that throw errors' , ( ) => {
3073
3094
// @gate enableSuspenseLayoutEffectSemantics
3074
3095
// @gate enableCache
3096
+ // @gate !persistent
3075
3097
// @gate replayFailedUnitOfWorkWithInvokeGuardedCallback
3076
3098
it ( 'are properly handled in ref callbacks' , async ( ) => {
3077
3099
let useRefCallbackShouldThrow = false ;
0 commit comments