Skip to content

Commit

Permalink
Gate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmarkbage committed Mar 8, 2022
1 parent 1aaa31b commit 333147a
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3197,7 +3197,7 @@ describe('ReactDOMServerPartialHydration', () => {
expect(span.innerHTML).toBe('Hidden child');
});

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

Expand Down Expand Up @@ -3225,7 +3225,7 @@ describe('ReactDOMServerPartialHydration', () => {
expect(span.innerHTML).toBe('Hidden child');
});

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

Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactUpdates-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ describe('ReactUpdates', () => {
expect(ops).toEqual(['Foo', 'Bar', 'Baz']);
});

// @gate experimental || www
// @gate www
it('delays sync updates inside hidden subtrees in Concurrent Mode', () => {
const container = document.createElement('div');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ describe('ReactLazyContextPropagation', () => {
expect(root).toMatchRenderedOutput('BB');
});

// @gate experimental || www
// @gate www
test('context is propagated through offscreen trees', async () => {
const LegacyHidden = React.unstable_LegacyHidden;

Expand Down Expand Up @@ -592,7 +592,7 @@ describe('ReactLazyContextPropagation', () => {
expect(root).toMatchRenderedOutput('BB');
});

// @gate experimental || www
// @gate www
test('multiple contexts are propagated across through offscreen trees', async () => {
// Same as previous test, but with multiple context providers
const LegacyHidden = React.unstable_LegacyHidden;
Expand Down Expand Up @@ -818,7 +818,7 @@ describe('ReactLazyContextPropagation', () => {
expect(root).toMatchRenderedOutput('BB');
});

// @gate experimental || www
// @gate www
test('nested bailouts through offscreen trees', async () => {
// Lazy context propagation will stop propagating when it hits the first
// match. If we bail out again inside that tree, we must resume propagating.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('ReactIncremental', () => {
expect(inst.state).toEqual({text: 'bar', text2: 'baz'});
});

// @gate experimental || www
// @gate www
it('can deprioritize unfinished work and resume it later', () => {
function Bar(props) {
Scheduler.unstable_yieldValue('Bar');
Expand Down Expand Up @@ -316,7 +316,7 @@ describe('ReactIncremental', () => {
expect(Scheduler).toFlushAndYield(['Middle', 'Middle']);
});

// @gate experimental || www
// @gate www
it('can deprioritize a tree from without dropping work', () => {
function Bar(props) {
Scheduler.unstable_yieldValue('Bar');
Expand Down Expand Up @@ -1999,7 +1999,7 @@ describe('ReactIncremental', () => {
});
}

// @gate experimental || www
// @gate www
it('provides context when reusing work', () => {
class Intl extends React.Component {
static childContextTypes = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ describe('ReactIncrementalErrorHandling', () => {
expect(ReactNoop.getChildren()).toEqual([span('Everything is fine.')]);
});

// @gate experimental || www
// @gate www
it('does not include offscreen work when retrying after an error', () => {
function App(props) {
if (props.isBroken) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ describe('ReactIncrementalSideEffects', () => {
]);
});

// @gate experimental || www
// @gate www
it('preserves a previously rendered node when deprioritized', () => {
function Middle(props) {
Scheduler.unstable_yieldValue('Middle');
Expand Down Expand Up @@ -475,7 +475,7 @@ describe('ReactIncrementalSideEffects', () => {
);
});

// @gate experimental || www
// @gate www
it('can reuse side-effects after being preempted', () => {
function Bar(props) {
Scheduler.unstable_yieldValue('Bar');
Expand Down Expand Up @@ -555,7 +555,7 @@ describe('ReactIncrementalSideEffects', () => {
);
});

// @gate experimental || www
// @gate www
it('can reuse side-effects after being preempted, if shouldComponentUpdate is false', () => {
class Bar extends React.Component {
shouldComponentUpdate(nextProps) {
Expand Down Expand Up @@ -690,7 +690,7 @@ describe('ReactIncrementalSideEffects', () => {
expect(ReactNoop.getChildrenAsJSX()).toEqual(<span prop={3} />);
});

// @gate experimental || www
// @gate www
it('updates a child even though the old props is empty', () => {
function Foo(props) {
return (
Expand Down Expand Up @@ -930,7 +930,7 @@ describe('ReactIncrementalSideEffects', () => {
expect(ops).toEqual(['Bar', 'Baz', 'Bar', 'Bar']);
});

// @gate experimental || www
// @gate www
it('deprioritizes setStates that happens within a deprioritized tree', () => {
const barInstances = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ describe('ReactNewContext', () => {
expect(ReactNoop.getChildren()).toEqual([span(2), span(2)]);
});

// @gate experimental || www
// @gate www
it("context consumer doesn't bail out inside hidden subtree", () => {
const Context = React.createContext('dark');
const Consumer = getConsumer(Context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ReactOffscreen', () => {
return <span prop={props.text} />;
}

// @gate experimental || www
// @gate www
it('unstable-defer-without-hiding should never toggle the visibility of its children', async () => {
function App({mode}) {
return (
Expand Down Expand Up @@ -85,7 +85,7 @@ describe('ReactOffscreen', () => {
);
});

// @gate experimental || www
// @gate www
it('does not defer in legacy mode', async () => {
let setState;
function Foo() {
Expand Down Expand Up @@ -130,7 +130,7 @@ describe('ReactOffscreen', () => {
);
});

// @gate experimental || www
// @gate www
it('does defer in concurrent mode', async () => {
let setState;
function Foo() {
Expand Down Expand Up @@ -310,7 +310,7 @@ describe('ReactOffscreen', () => {
expect(root).toMatchRenderedOutput(<span hidden={true} prop="Child" />);
});

// @gate experimental || www
// @gate www
it('does not toggle effects for LegacyHidden component', async () => {
// LegacyHidden is meant to be the same as offscreen except it doesn't
// do anything to effects. Only used by www, as a temporary migration step.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ describe('ReactSchedulerIntegration', () => {
expect(Scheduler).toHaveYielded(['A', 'B', 'C']);
});

// @gate experimental || www
// @gate www
it('idle updates are not blocked by offscreen work', async () => {
function Text({text}) {
Scheduler.unstable_yieldValue(text);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3073,7 +3073,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
expect(root).toMatchRenderedOutput(<span prop="Foo" />);
});

// @gate enableCache
// @gate enableCache && enableLegacyHidden
it('should not render hidden content while suspended on higher pri', async () => {
function Offscreen() {
Scheduler.unstable_yieldValue('Offscreen');
Expand Down Expand Up @@ -3123,7 +3123,7 @@ describe('ReactSuspenseWithNoopRenderer', () => {
);
});

// @gate enableCache
// @gate enableCache && enableLegacyHidden
it('should be able to unblock higher pri content before suspended hidden', async () => {
function Offscreen() {
Scheduler.unstable_yieldValue('Offscreen');
Expand Down
1 change: 1 addition & 0 deletions packages/react-refresh/src/__tests__/ReactFresh-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2411,6 +2411,7 @@ describe('ReactFresh', () => {
}
});

// @gate www
it('can hot reload offscreen components', async () => {
if (__DEV__ && __EXPERIMENTAL__) {
const AppV1 = prepare(() => {
Expand Down

0 comments on commit 333147a

Please sign in to comment.