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

fix[devtools/profilingCache-test]: specify correct version gate for test #27008

Merged
merged 1 commit into from
Jun 26, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,51 @@ describe('ProfilingCache', () => {
}
});

// @reactVersion >= 17
// @reactVersion < 18
// @reactVersion >= 18.0.0
// @reactVersion <= 18.2.0
it('should handle unexpectedly shallow suspense trees for react v[18.0.0 - 18.2.0]', () => {
const container = document.createElement('div');

utils.act(() => store.profilerStore.startProfiling());
utils.act(() => legacyRender(<React.Suspense />, container));
utils.act(() => store.profilerStore.stopProfiling());

const rootID = store.roots[0];
const commitData = store.profilerStore.getDataForRoot(rootID).commitData;
expect(commitData).toMatchInlineSnapshot(`
[
{
"changeDescriptions": Map {},
"duration": 0,
"effectDuration": null,
"fiberActualDurations": Map {
1 => 0,
2 => 0,
},
"fiberSelfDurations": Map {
1 => 0,
2 => 0,
},
"passiveEffectDuration": null,
"priorityLevel": "Immediate",
"timestamp": 0,
"updaters": [
{
"displayName": "render()",
"hocDisplayNames": null,
"id": 1,
"key": null,
"type": 11,
},
],
},
]
`);
});

// This test is not gated.
// For this test we use the current version of react, built from source.
it('should handle unexpectedly shallow suspense trees', () => {
// This test only runs in v17 because it's a regression test for legacy
// Suspense behavior, and the implementation details changed in v18.
const container = document.createElement('div');

utils.act(() => store.profilerStore.startProfiling());
Expand Down