Skip to content

Commit 202fdec

Browse files
committed
Update tests to reflect that we're now including unmount times for deleted subtrees
1 parent aa36862 commit 202fdec

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

packages/react/src/__tests__/ReactProfiler-test.internal.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ describe(`onCommit`, () => {
16431643
expect(call).toHaveLength(4);
16441644
expect(call[0]).toBe('root-update');
16451645
expect(call[1]).toBe('update');
1646-
expect(call[2]).toBe(1100); // durations
1646+
expect(call[2]).toBe(11100); // durations
16471647
expect(call[3]).toBe(1124); // commit start time (before mutations or effects)
16481648
});
16491649

@@ -1952,11 +1952,7 @@ describe(`onPostCommit`, () => {
19521952
expect(call).toHaveLength(4);
19531953
expect(call[0]).toBe('unmount-test');
19541954
expect(call[1]).toBe('update');
1955-
// TODO (bvaughn) The duration reported below should be 10100, but is 0
1956-
// by the time the passive effect is flushed its parent Fiber pointer is gone.
1957-
// If we refactor to preserve the unmounted Fiber tree we could fix this.
1958-
// The current implementation would require too much extra overhead to track this.
1959-
expect(call[2]).toBe(0); // durations
1955+
expect(call[2]).toBe(10100); // durations
19601956
expect(call[3]).toBe(12030); // commit start time (before mutations or effects)
19611957
});
19621958

@@ -2085,7 +2081,7 @@ describe(`onPostCommit`, () => {
20852081
expect(call).toHaveLength(4);
20862082
expect(call[0]).toBe('root-update');
20872083
expect(call[1]).toBe('update');
2088-
expect(call[2]).toBe(1100); // durations
2084+
expect(call[2]).toBe(11100); // durations
20892085
expect(call[3]).toBe(1124); // commit start time (before mutations or effects)
20902086
});
20912087

@@ -2300,7 +2296,7 @@ describe(`onPostCommit`, () => {
23002296
expect(call).toHaveLength(4);
23012297
expect(call[0]).toBe('root');
23022298
expect(call[1]).toBe('update');
2303-
expect(call[2]).toBe(100000000); // durations
2299+
expect(call[2]).toBe(100001000); // durations
23042300
// The commit time varies because the above duration time varies
23052301
expect(call[3]).toBe(11221221); // commit start time (before mutations or effects)
23062302
});

0 commit comments

Comments
 (0)