Skip to content

Commit 9f5105c

Browse files
committed
check all spans at the end
1 parent 931ff47 commit 9f5105c

File tree

1 file changed

+13
-8
lines changed
  • packages/integration-tests/suites/replay/customEvents

1 file changed

+13
-8
lines changed

packages/integration-tests/suites/replay/customEvents/test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ sentryTest('replay recording should contain default performance spans', async ({
3535
const { performanceSpans: performanceSpans0 } = getCustomRecordingEvents(await reqPromise0);
3636

3737
expect(replayEvent0).toEqual(getExpectedReplayEvent({ segment_id: 0 }));
38-
expect(performanceSpans0).toEqual([expectedMemoryPerformanceSpan]);
3938

4039
await page.click('button');
4140

@@ -44,11 +43,17 @@ sentryTest('replay recording should contain default performance spans', async ({
4443

4544
expect(replayEvent1).toEqual(getExpectedReplayEvent({ segment_id: 1, urls: [], replay_start_timestamp: undefined }));
4645

47-
expect(performanceSpans1).toEqual([
48-
expectedNavigationPerformanceSpan,
49-
expectedLCPPerformanceSpan,
50-
expectedFPPerformanceSpan,
51-
expectedFCPPerformanceSpan,
52-
expectedMemoryPerformanceSpan,
53-
]);
46+
const collectedPerformanceSpans = [...performanceSpans0, ...performanceSpans1];
47+
48+
expect(collectedPerformanceSpans.length).toBe(6);
49+
expect(collectedPerformanceSpans).toEqual(
50+
expect.arrayContaining([
51+
expectedNavigationPerformanceSpan,
52+
expectedLCPPerformanceSpan,
53+
expectedFPPerformanceSpan,
54+
expectedFCPPerformanceSpan,
55+
expectedMemoryPerformanceSpan, // two memory spans - once per flush
56+
expectedMemoryPerformanceSpan,
57+
]),
58+
);
5459
});

0 commit comments

Comments
 (0)