-
Notifications
You must be signed in to change notification settings - Fork 49.6k
Fix some DevTools regression test actions and assertions #34459
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -724,34 +724,69 @@ describe('ProfilingCache', () => { | |
const rootID = store.roots[0]; | ||
const commitData = store.profilerStore.getDataForRoot(rootID).commitData; | ||
expect(commitData).toHaveLength(2); | ||
expect(commitData[0].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 15, | ||
2 => 15, | ||
3 => 5, | ||
4 => 2, | ||
} | ||
`); | ||
expect(commitData[0].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 0, | ||
2 => 10, | ||
3 => 3, | ||
4 => 2, | ||
} | ||
`); | ||
expect(commitData[1].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
5 => 3, | ||
3 => 3, | ||
} | ||
`); | ||
expect(commitData[1].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
5 => 3, | ||
3 => 0, | ||
} | ||
`); | ||
|
||
const isLegacySuspense = React.version.startsWith('17'); | ||
if (isLegacySuspense) { | ||
expect(commitData[0].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 15, | ||
2 => 15, | ||
3 => 5, | ||
4 => 3, | ||
5 => 2, | ||
Comment on lines
+728
to
+736
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to bisect where the additional node comes from. I suspect something legacy Suspense related similar to the other snapshot tests that had a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
} | ||
`); | ||
expect(commitData[0].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 0, | ||
2 => 10, | ||
3 => 3, | ||
4 => 3, | ||
5 => 2, | ||
} | ||
`); | ||
expect(commitData[1].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
6 => 3, | ||
3 => 3, | ||
} | ||
`); | ||
expect(commitData[1].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
6 => 3, | ||
3 => 0, | ||
} | ||
`); | ||
} else { | ||
expect(commitData[0].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 15, | ||
2 => 15, | ||
3 => 5, | ||
4 => 2, | ||
} | ||
`); | ||
expect(commitData[0].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
1 => 0, | ||
2 => 10, | ||
3 => 3, | ||
4 => 2, | ||
} | ||
`); | ||
expect(commitData[1].fiberActualDurations).toMatchInlineSnapshot(` | ||
Map { | ||
5 => 3, | ||
3 => 3, | ||
} | ||
`); | ||
expect(commitData[1].fiberSelfDurations).toMatchInlineSnapshot(` | ||
Map { | ||
5 => 3, | ||
3 => 0, | ||
} | ||
`); | ||
} | ||
}); | ||
|
||
// @reactVersion >= 16.9 | ||
|
@@ -866,6 +901,7 @@ describe('ProfilingCache', () => { | |
"hocDisplayNames": null, | ||
"id": 1, | ||
"key": null, | ||
"stack": null, | ||
"type": 11, | ||
}, | ||
], | ||
|
@@ -908,6 +944,7 @@ describe('ProfilingCache', () => { | |
"hocDisplayNames": null, | ||
"id": 1, | ||
"key": null, | ||
"stack": null, | ||
"type": 11, | ||
}, | ||
], | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ describe('Store component filters', () => { | |
`); | ||
}); | ||
|
||
// @reactVersion >= 16.0 | ||
// @reactVersion >= 16.6 | ||
it('should filter Suspense', async () => { | ||
Comment on lines
+137
to
138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
const Suspense = React.Suspense; | ||
await actAsync(async () => | ||
|
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accounts for https://github.com/facebook/react/pull/34095/files#diff-94a124a1b825898267d7c9f43ef03cafaf2f55da968b1bd46d1f5ffea9def7bfR233.
Didn't think it's worth it to add even more test-specific markup