@@ -156,17 +156,11 @@ describe('ReactIncrementalUpdates', () => {
156
156
}
157
157
158
158
// Schedule some async updates
159
- if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
160
- React . startTransition ( ( ) => {
161
- instance . setState ( createUpdate ( 'a' ) ) ;
162
- instance . setState ( createUpdate ( 'b' ) ) ;
163
- instance . setState ( createUpdate ( 'c' ) ) ;
164
- } ) ;
165
- } else {
159
+ React . startTransition ( ( ) => {
166
160
instance . setState ( createUpdate ( 'a' ) ) ;
167
161
instance . setState ( createUpdate ( 'b' ) ) ;
168
162
instance . setState ( createUpdate ( 'c' ) ) ;
169
- }
163
+ } ) ;
170
164
171
165
// Begin the updates but don't flush them yet
172
166
await waitFor ( [ 'a' , 'b' , 'c' ] ) ;
@@ -183,14 +177,8 @@ describe('ReactIncrementalUpdates', () => {
183
177
} ) ;
184
178
185
179
// The sync updates should have flushed, but not the async ones.
186
- if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
187
- assertLog ( [ 'd' , 'e' , 'f' ] ) ;
188
- expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "def" /> ) ;
189
- } else {
190
- // Update d was dropped and replaced by e.
191
- assertLog ( [ 'e' , 'f' ] ) ;
192
- expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "ef" /> ) ;
193
- }
180
+ assertLog ( [ 'd' , 'e' , 'f' ] ) ;
181
+ expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "def" /> ) ;
194
182
195
183
// Now flush the remaining work. Even though e and f were already processed,
196
184
// they should be processed again, to ensure that the terminal state
@@ -231,17 +219,11 @@ describe('ReactIncrementalUpdates', () => {
231
219
}
232
220
233
221
// Schedule some async updates
234
- if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
235
- React . startTransition ( ( ) => {
236
- instance . setState ( createUpdate ( 'a' ) ) ;
237
- instance . setState ( createUpdate ( 'b' ) ) ;
238
- instance . setState ( createUpdate ( 'c' ) ) ;
239
- } ) ;
240
- } else {
222
+ React . startTransition ( ( ) => {
241
223
instance . setState ( createUpdate ( 'a' ) ) ;
242
224
instance . setState ( createUpdate ( 'b' ) ) ;
243
225
instance . setState ( createUpdate ( 'c' ) ) ;
244
- }
226
+ } ) ;
245
227
246
228
// Begin the updates but don't flush them yet
247
229
await waitFor ( [ 'a' , 'b' , 'c' ] ) ;
@@ -261,45 +243,22 @@ describe('ReactIncrementalUpdates', () => {
261
243
} ) ;
262
244
263
245
// The sync updates should have flushed, but not the async ones.
264
- if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
265
- assertLog ( [ 'd' , 'e' , 'f' ] ) ;
266
- } else {
267
- // Update d was dropped and replaced by e.
268
- assertLog ( [ 'e' , 'f' ] ) ;
269
- }
246
+ assertLog ( [ 'd' , 'e' , 'f' ] ) ;
270
247
expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "f" /> ) ;
271
248
272
249
// Now flush the remaining work. Even though e and f were already processed,
273
250
// they should be processed again, to ensure that the terminal state
274
251
// is deterministic.
275
- if ( gate ( flags => ! flags . forceConcurrentByDefaultForTesting ) ) {
276
- await waitForAll ( [
277
- // Since 'g' is in a transition, we'll process 'd' separately first.
278
- // That causes us to process 'd' with 'e' and 'f' rebased.
279
- 'd' ,
280
- 'e' ,
281
- 'f' ,
282
- // Then we'll re-process everything for 'g'.
283
- 'a' ,
284
- 'b' ,
285
- 'c' ,
286
- 'd' ,
287
- 'e' ,
288
- 'f' ,
289
- 'g' ,
290
- ] ) ;
291
- } else {
292
- await waitForAll ( [
293
- // Then we'll re-process everything for 'g'.
294
- 'a' ,
295
- 'b' ,
296
- 'c' ,
297
- 'd' ,
298
- 'e' ,
299
- 'f' ,
300
- 'g' ,
301
- ] ) ;
302
- }
252
+ await waitForAll ( [
253
+ // Then we'll re-process everything for 'g'.
254
+ 'a' ,
255
+ 'b' ,
256
+ 'c' ,
257
+ 'd' ,
258
+ 'e' ,
259
+ 'f' ,
260
+ 'g' ,
261
+ ] ) ;
303
262
expect ( ReactNoop ) . toMatchRenderedOutput ( < span prop = "fg" /> ) ;
304
263
} ) ;
305
264
0 commit comments