Skip to content

Commit 8b113b8

Browse files
author
Brian Vaughn
committed
Update tests to account for new event data in snapshots
1 parent 4409be8 commit 8b113b8

File tree

1 file changed

+41
-37
lines changed

1 file changed

+41
-37
lines changed

packages/react-devtools-scheduling-profiler/src/import-worker/__tests__/preprocessData-test.internal.js

Lines changed: 41 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ describe(preprocessData, () => {
204204

205205
expect(preprocessData([cpuProfilerSample, randomSample])).toStrictEqual({
206206
duration: 0.002,
207-
events: [],
208207
flamechart: [],
209208
measures: [],
209+
nativeEvents: [],
210210
otherUserTimingMarks: [],
211+
reactEvents: [],
211212
startTime: 1,
212213
});
213214
});
@@ -258,15 +259,6 @@ describe(preprocessData, () => {
258259
]),
259260
).toStrictEqual({
260261
duration: 0.008,
261-
events: [
262-
{
263-
componentStack: '',
264-
laneLabels: [],
265-
lanes: [9],
266-
timestamp: 0.002,
267-
type: 'schedule-render',
268-
},
269-
],
270262
flamechart: [],
271263
measures: [
272264
{
@@ -306,7 +298,17 @@ describe(preprocessData, () => {
306298
type: 'layout-effects',
307299
},
308300
],
301+
nativeEvents: [],
309302
otherUserTimingMarks: [],
303+
reactEvents: [
304+
{
305+
componentStack: '',
306+
laneLabels: [],
307+
lanes: [9],
308+
timestamp: 0.002,
309+
type: 'schedule-render',
310+
},
311+
],
310312
startTime: 1,
311313
});
312314
});
@@ -320,15 +322,6 @@ describe(preprocessData, () => {
320322
const userTimingData = createUserTimingData(clearedMarks);
321323
expect(preprocessData(userTimingData)).toStrictEqual({
322324
duration: 0.011,
323-
events: [
324-
{
325-
componentStack: '',
326-
laneLabels: ['Sync'],
327-
lanes: [0],
328-
timestamp: 0.005,
329-
type: 'schedule-render',
330-
},
331-
],
332325
flamechart: [],
333326
measures: [
334327
{
@@ -368,6 +361,7 @@ describe(preprocessData, () => {
368361
type: 'layout-effects',
369362
},
370363
],
364+
nativeEvents: [],
371365
otherUserTimingMarks: [
372366
{
373367
name: '__v3',
@@ -378,6 +372,15 @@ describe(preprocessData, () => {
378372
timestamp: 0.004,
379373
},
380374
],
375+
reactEvents: [
376+
{
377+
componentStack: '',
378+
laneLabels: ['Sync'],
379+
lanes: [0],
380+
timestamp: 0.005,
381+
type: 'schedule-render',
382+
},
383+
],
381384
startTime: 1,
382385
});
383386
});
@@ -400,24 +403,6 @@ describe(preprocessData, () => {
400403
const userTimingData = createUserTimingData(clearedMarks);
401404
expect(preprocessData(userTimingData)).toStrictEqual({
402405
duration: 0.022,
403-
events: [
404-
{
405-
componentStack: '',
406-
laneLabels: ['Default'],
407-
lanes: [4],
408-
timestamp: 0.005,
409-
type: 'schedule-render',
410-
},
411-
{
412-
componentName: 'App',
413-
componentStack: '',
414-
isCascading: false,
415-
laneLabels: ['Default'],
416-
lanes: [4],
417-
timestamp: 0.013,
418-
type: 'schedule-state-update',
419-
},
420-
],
421406
flamechart: [],
422407
measures: [
423408
{
@@ -511,6 +496,7 @@ describe(preprocessData, () => {
511496
type: 'passive-effects',
512497
},
513498
],
499+
nativeEvents: [],
514500
otherUserTimingMarks: [
515501
{
516502
name: '__v3',
@@ -521,6 +507,24 @@ describe(preprocessData, () => {
521507
timestamp: 0.004,
522508
},
523509
],
510+
reactEvents: [
511+
{
512+
componentStack: '',
513+
laneLabels: ['Default'],
514+
lanes: [4],
515+
timestamp: 0.005,
516+
type: 'schedule-render',
517+
},
518+
{
519+
componentName: 'App',
520+
componentStack: '',
521+
isCascading: false,
522+
laneLabels: ['Default'],
523+
lanes: [4],
524+
timestamp: 0.013,
525+
type: 'schedule-state-update',
526+
},
527+
],
524528
startTime: 1,
525529
});
526530
});

0 commit comments

Comments
 (0)