Skip to content

Commit d21067a

Browse files
authored
test(replay): Ensure LCP spans have equals start and end timestamps (#7229)
(Playwright)
1 parent c8945ed commit d21067a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
expectedNavigationPerformanceSpan,
1111
getExpectedReplayEvent,
1212
} from '../../../utils/replayEventTemplates';
13+
import type { PerformanceSpan } from '../../../utils/replayHelpers';
1314
import {
1415
getCustomRecordingEvents,
1516
getReplayEvent,
@@ -68,6 +69,13 @@ sentryTest(
6869
expectedMemoryPerformanceSpan,
6970
]),
7071
);
72+
73+
const lcpSpan = collectedPerformanceSpans.find(
74+
s => s.description === 'largest-contentful-paint',
75+
) as PerformanceSpan;
76+
77+
// LCP spans should be point-in-time spans
78+
expect(lcpSpan?.startTimestamp).toBeCloseTo(lcpSpan?.endTimestamp);
7179
},
7280
);
7381

packages/integration-tests/utils/replayHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type { Page, Request } from 'playwright';
66
import { envelopeRequestParser } from './helpers';
77

88
type CustomRecordingEvent = { tag: string; payload: Record<string, unknown> };
9-
type PerformanceSpan = {
9+
export type PerformanceSpan = {
1010
op: string;
1111
description: string;
1212
startTimestamp: number;

0 commit comments

Comments
 (0)