@@ -68,66 +68,6 @@ describe('ReactSchedulerIntegration', () => {
6868 ) ;
6969 }
7070
71- // TODO: Figure out what to do with these tests. I don't think most of them
72- // make sense once we decouple Scheduler from React. Perhaps need similar
73- // tests for React DOM.
74- // @gate !enableNativeEventPriorityInference
75- it ( 'has correct priority during rendering' , ( ) => {
76- function ReadPriority ( ) {
77- Scheduler . unstable_yieldValue (
78- 'Priority: ' + getCurrentPriorityAsString ( ) ,
79- ) ;
80- return null ;
81- }
82- ReactNoop . render ( < ReadPriority /> ) ;
83- expect ( Scheduler ) . toFlushAndYield ( [ 'Priority: Normal' ] ) ;
84-
85- runWithPriority ( UserBlockingPriority , ( ) => {
86- ReactNoop . render ( < ReadPriority /> ) ;
87- } ) ;
88- expect ( Scheduler ) . toFlushAndYield ( [ 'Priority: UserBlocking' ] ) ;
89-
90- runWithPriority ( IdlePriority , ( ) => {
91- ReactNoop . render ( < ReadPriority /> ) ;
92- } ) ;
93- expect ( Scheduler ) . toFlushAndYield ( [ 'Priority: Idle' ] ) ;
94- } ) ;
95-
96- // TODO: Figure out what to do with these tests. I don't think most of them
97- // make sense once we decouple Scheduler from React. Perhaps need similar
98- // tests for React DOM.
99- // @gate !enableNativeEventPriorityInference
100- it ( 'has correct priority when continuing a render after yielding' , ( ) => {
101- function ReadPriority ( ) {
102- Scheduler . unstable_yieldValue (
103- 'Priority: ' + getCurrentPriorityAsString ( ) ,
104- ) ;
105- return null ;
106- }
107-
108- runWithPriority ( UserBlockingPriority , ( ) => {
109- ReactNoop . render (
110- < >
111- < ReadPriority />
112- < ReadPriority />
113- < ReadPriority />
114- </ > ,
115- ) ;
116- } ) ;
117-
118- // Render part of the tree
119- expect ( Scheduler ) . toFlushAndYieldThrough ( [ 'Priority: UserBlocking' ] ) ;
120-
121- // Priority is set back to normal when yielding
122- expect ( getCurrentPriorityAsString ( ) ) . toEqual ( 'Normal' ) ;
123-
124- // Priority is restored to user-blocking when continuing
125- expect ( Scheduler ) . toFlushAndYield ( [
126- 'Priority: UserBlocking' ,
127- 'Priority: UserBlocking' ,
128- ] ) ;
129- } ) ;
130-
13171 it ( 'passive effects are called before Normal-pri scheduled in layout effects' , async ( ) => {
13272 const { useEffect, useLayoutEffect} = React ;
13373 function Effects ( { step} ) {
@@ -172,28 +112,6 @@ describe('ReactSchedulerIntegration', () => {
172112 ] ) ;
173113 } ) ;
174114
175- // TODO: Figure out what to do with these tests. I don't think most of them
176- // make sense once we decouple Scheduler from React. Perhaps need similar
177- // tests for React DOM.
178- // @gate !enableNativeEventPriorityInference
179- it ( 'after completing a level of work, infers priority of the next batch based on its expiration time' , ( ) => {
180- function App ( { label} ) {
181- Scheduler . unstable_yieldValue (
182- `${ label } [${ getCurrentPriorityAsString ( ) } ]` ,
183- ) ;
184- return label ;
185- }
186-
187- // Schedule two separate updates at different priorities
188- runWithPriority ( UserBlockingPriority , ( ) => {
189- ReactNoop . render ( < App label = "A" /> ) ;
190- } ) ;
191- ReactNoop . render ( < App label = "B" /> ) ;
192-
193- // The second update should run at normal priority
194- expect ( Scheduler ) . toFlushAndYield ( [ 'A [UserBlocking]' , 'B [Normal]' ] ) ;
195- } ) ;
196-
197115 it ( 'requests a paint after committing' , ( ) => {
198116 const scheduleCallback = Scheduler . unstable_scheduleCallback ;
199117
0 commit comments