Skip to content

Commit 86715ef

Browse files
authored
Resolve the true entry point during tests (#21505)
* Resolve the entry point for tests the same way builds do This way the source tests, test the same entry point configuration. * Gate test selectors on www These are currently only exposed in www builds * Gate createEventHandle / useFocus on www These are enabled in both www variants but not OSS experimental. * Temporarily disable www-modern entry point Use the main one that has all the exports until we fix more tests. * Remove enableCache override that's no longer correct * Open gates for www These used to not be covered because they used Cache which wasn't exposed.
1 parent a8a4742 commit 86715ef

26 files changed

+223
-205
lines changed

packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ describe('ReactDOMFiberAsync', () => {
286286
expect(ops).toEqual(['BC', 'ABCD']);
287287
});
288288

289-
// @gate experimental
289+
// @gate experimental || www
290290
it('flushControlled flushes updates before yielding to browser', () => {
291291
let inst;
292292
class Counter extends React.Component {
@@ -326,7 +326,7 @@ describe('ReactDOMFiberAsync', () => {
326326
]);
327327
});
328328

329-
// @gate experimental
329+
// @gate experimental || www
330330
it('flushControlled does not flush until end of outermost batchedUpdates', () => {
331331
let inst;
332332
class Counter extends React.Component {
@@ -357,7 +357,7 @@ describe('ReactDOMFiberAsync', () => {
357357
]);
358358
});
359359

360-
// @gate experimental
360+
// @gate experimental || www
361361
it('flushControlled returns nothing', () => {
362362
// In the future, we may want to return a thenable "work" object.
363363
let inst;

packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ describe('ReactDOMServerPartialHydration', () => {
571571
expect(span.className).toBe('hi');
572572
});
573573

574-
// @gate experimental
574+
// @gate experimental || www
575575
it('blocks updates to hydrate the content first if props changed at idle priority', async () => {
576576
let suspend = false;
577577
let resolve;
@@ -1498,7 +1498,7 @@ describe('ReactDOMServerPartialHydration', () => {
14981498
expect(container.textContent).toBe('ALoading B');
14991499
});
15001500

1501-
// @gate experimental
1501+
// @gate experimental || www
15021502
it('clears server boundaries when SuspenseList runs out of time hydrating', async () => {
15031503
let suspend = false;
15041504
let resolve;
@@ -1912,7 +1912,7 @@ describe('ReactDOMServerPartialHydration', () => {
19121912
document.body.removeChild(container);
19131913
});
19141914

1915-
// @gate experimental
1915+
// @gate www
19161916
it('does not invoke an event on a hydrated event handle until it commits', async () => {
19171917
const setClick = ReactDOM.unstable_createEventHandle('click');
19181918
let suspend = false;
@@ -2077,7 +2077,7 @@ describe('ReactDOMServerPartialHydration', () => {
20772077
document.body.removeChild(container);
20782078
});
20792079

2080-
// @gate experimental
2080+
// @gate www
20812081
it('invokes discrete events on nested suspense boundaries in a root (createEventHandle)', async () => {
20822082
let suspend = false;
20832083
let isServerRendering = true;
@@ -2617,7 +2617,7 @@ describe('ReactDOMServerPartialHydration', () => {
26172617
expect(span.innerHTML).toBe('Hidden child');
26182618
});
26192619

2620-
// @gate experimental
2620+
// @gate experimental || www
26212621
it('renders a hidden LegacyHidden component inside a Suspense boundary', async () => {
26222622
const ref = React.createRef();
26232623

@@ -2646,7 +2646,7 @@ describe('ReactDOMServerPartialHydration', () => {
26462646
expect(span.innerHTML).toBe('Hidden child');
26472647
});
26482648

2649-
// @gate experimental
2649+
// @gate experimental || www
26502650
it('renders a visible LegacyHidden component', async () => {
26512651
const ref = React.createRef();
26522652

packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
369369
document.body.removeChild(container);
370370
});
371371

372-
// @gate experimental
372+
// @gate www
373373
it('hydrates the target boundary synchronously during a click (createEventHandle)', async () => {
374374
const setClick = ReactDOM.unstable_createEventHandle('click');
375375
let isServerRendering = true;
@@ -438,7 +438,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
438438
document.body.removeChild(container);
439439
});
440440

441-
// @gate experimental
441+
// @gate www
442442
it('hydrates at higher pri if sync did not work first time (createEventHandle)', async () => {
443443
let suspend = false;
444444
let isServerRendering = true;
@@ -526,7 +526,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
526526
document.body.removeChild(container);
527527
});
528528

529-
// @gate experimental
529+
// @gate www
530530
it('hydrates at higher pri for secondary discrete events (createEventHandle)', async () => {
531531
const setClick = ReactDOM.unstable_createEventHandle('click');
532532
let suspend = false;
@@ -812,7 +812,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
812812
document.body.removeChild(container);
813813
});
814814

815-
// @gate experimental
815+
// @gate experimental || www
816816
it('hydrates the last explicitly hydrated target at higher priority', async () => {
817817
function Child({text}) {
818818
Scheduler.unstable_yieldValue(text);
@@ -861,7 +861,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
861861
expect(Scheduler).toFlushAndYield(['App', 'C', 'B', 'A']);
862862
});
863863

864-
// @gate experimental
864+
// @gate experimental || www
865865
it('hydrates before an update even if hydration moves away from it', async () => {
866866
function Child({text}) {
867867
Scheduler.unstable_yieldValue(text);

0 commit comments

Comments
 (0)