50
);
51
}
52
53
+ // @gate enableSuspenseyImages
54
it('suspend commit during initial mount', async () => {
55
const root = ReactNoop.createRoot();
56
await act(async () => {
71
expect(root).toMatchRenderedOutput(<suspensey-thing src="A" />);
72
});
73
74
+ // @gate enableSuspenseyImages
75
it('suspend commit during update', async () => {
76
const root = ReactNoop.createRoot();
77
await act(() => resolveSuspenseyThing('A'));
107
expect(root).toMatchRenderedOutput(<suspensey-thing src="B" />);
108
});
109
110
+ // @gate enableSuspenseyImages
111
it('suspend commit during initial mount at the root', async () => {
112
const root = ReactNoop.createRoot();
113
await act(async () => {
124
expect(root).toMatchRenderedOutput(<suspensey-thing src="A" />);
125
});
126
127
+ // @gate enableSuspenseyImages
128
it('suspend commit during update at the root', async () => {
129
const root = ReactNoop.createRoot();
130
await act(() => resolveSuspenseyThing('A'));
151
expect(root).toMatchRenderedOutput(<suspensey-thing src="B" />);
152
});
153
154
+ // @gate enableSuspenseyImages
155
it('suspend commit during urgent initial mount', async () => {
156
const root = ReactNoop.createRoot();
157
await act(async () => {
170
expect(root).toMatchRenderedOutput(<suspensey-thing src="A" />);
171
});
172
173
+ // @gate enableSuspenseyImages
174
it('suspend commit during urgent update', async () => {
175
const root = ReactNoop.createRoot();
176
await act(() => resolveSuspenseyThing('A'));
209
expect(root).toMatchRenderedOutput(<suspensey-thing src="B" />);
210
});
211
212
+ // @gate enableSuspenseyImages
213
it('suspends commit during urgent initial mount at the root', async () => {
214
const root = ReactNoop.createRoot();
215
await act(async () => {
224
expect(root).toMatchRenderedOutput(<suspensey-thing src="A" />);
225
});
226
227
+ // @gate enableSuspenseyImages
228
it('suspends commit during urgent update at the root', async () => {
229
const root = ReactNoop.createRoot();
230
await act(() => resolveSuspenseyThing('A'));
247
expect(root).toMatchRenderedOutput(<suspensey-thing src="B" />);
248
});
249
250
+ // @gate enableSuspenseyImages
251
it('does suspend commit during urgent initial mount at the root when sync rendering', async () => {
252
const root = ReactNoop.createRoot();
253
await act(async () => {
265
expect(root).toMatchRenderedOutput(<suspensey-thing src="A" />);
266
});
267
268
+ // @gate enableSuspenseyImages
269
it('does suspend commit during urgent update at the root when sync rendering', async () => {
270
const root = ReactNoop.createRoot();
271
await act(() => resolveSuspenseyThing('A'));
293
expect(root).toMatchRenderedOutput(<suspensey-thing src="B" />);
294
});
295
296
+ // @gate enableSuspenseyImages
297
it('an urgent update interrupts a suspended commit', async () => {
298
const root = ReactNoop.createRoot();
299
316
expect(root).toMatchRenderedOutput('Something else');
317
});
318
319
+ // @gate enableSuspenseyImages
320
it('a transition update interrupts a suspended commit', async () => {
321
const root = ReactNoop.createRoot();
322
341
expect(root).toMatchRenderedOutput('Something else');
342
});
343
332
- // @gate enableSuspenseList
344
+ // @gate enableSuspenseList && enableSuspenseyImages
345
it('demonstrate current behavior when used with SuspenseList (not ideal)', async () => {
346
function App() {
347
return (
393
);
394
});
395
396
+ // @gate enableSuspenseyImages
397
it('avoid triggering a fallback if resource loads immediately', async () => {
398
const root = ReactNoop.createRoot();
399
await act(async () => {
442
);
443
});
444
432
- // @gate enableActivity
445
+ // @gate enableActivity && enableSuspenseyImages
446
it("host instances don't suspend during prerendering, but do suspend when they are revealed", async () => {
447
function More() {
448
Scheduler.log('More');
506
});
507
508
// FIXME: Should pass with `enableYieldingBeforePassive`
496
- // @gate !enableYieldingBeforePassive
509
+ // @gate !enableYieldingBeforePassive && enableSuspenseyImages
510
it('runs passive effects after suspended commit resolves', async () => {
511
function Effect() {
512
React.useEffect(() => {