Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fiber] Add failing tests for context #8593

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -993,5 +993,18 @@ describe('ReactDOMFiber', () => {
'leave parent', // Only when we leave the portal does onMouseLeave fire.
]);
});

it('keeps track of namespaces despite low priority bailout', () => {
assertNamespacesMatch(
<svg {...expectSVG}>
{/*
TODO: this relies on the magic `hidden` attribute in Fiber.
Figure out a better test.
*/}
<foreignObject hidden={true} {...expectSVG} />
<image {...expectSVG} />
</svg>
);
});
}
});
25 changes: 25 additions & 0 deletions src/renderers/shared/fiber/__tests__/ReactIncremental-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,31 @@ describe('ReactIncremental', () => {
'ShowBoth {"locale":"en","route":"/about"}',
'ShowBoth {"locale":"en"}',
]);

ops.length = 0;
ReactNoop.render(
<Intl locale="zh">
<ShowLocale />
<Router route="/about">
<Indirection />
</Router>
<ShowBoth />
</Intl>
);
ReactNoop.flush();
expect(ops).toEqual([
'Intl {}',
'ShowLocale {"locale":"zh"}',
'Router {}',
'Indirection {}',
'ShowLocale {"locale":"zh"}',
'ShowRoute {"route":"/about"}',
'ShowNeither {}',
'Intl {}',
'ShowBoth {"locale":"ru","route":"/about"}',
'ShowBoth {"locale":"zh","route":"/about"}',
'ShowBoth {"locale":"zh"}',
]);
});

it('does not leak own context into context provider', () => {
Expand Down