Skip to content

Commit ea8f193

Browse files
committed
update tests and refactor
1 parent 1d3c5f0 commit ea8f193

File tree

4 files changed

+11
-38
lines changed

4 files changed

+11
-38
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88
expectedFIDPerformanceSpan,
99
expectedFPPerformanceSpan,
1010
expectedLCPPerformanceSpan,
11+
expectedCLSPerformanceSpan,
12+
expectedFIDPerformanceSpan,
13+
expectedINPPerformanceSpan,
1114
expectedMemoryPerformanceSpan,
1215
expectedNavigationPerformanceSpan,
1316
getExpectedReplayEvent,

dev-packages/browser-integration-tests/suites/replay/multiple-pages/test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import {
88
expectedFIDPerformanceSpan,
99
expectedFPPerformanceSpan,
1010
expectedLCPPerformanceSpan,
11+
expectedCLSPerformanceSpan,
12+
expectedFIDPerformanceSpan,
13+
expectedINPPerformanceSpan,
1114
expectedMemoryPerformanceSpan,
1215
expectedNavigationBreadcrumb,
1316
expectedNavigationPerformanceSpan,

packages/replay-internal/src/types/performance.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,42 +113,6 @@ export interface WebVitalData {
113113
nodeId?: number;
114114
}
115115

116-
export interface CumulativeLayoutShiftData {
117-
/**
118-
* Render time (in ms) of the CLS
119-
*/
120-
value: number;
121-
size: number;
122-
/**
123-
* The recording id of the CLS node. -1 if not found
124-
*/
125-
nodeId?: number;
126-
}
127-
128-
export interface FirstInputDelayData {
129-
/**
130-
* Render time (in ms) of the FID
131-
*/
132-
value: number;
133-
size: number;
134-
/**
135-
* The recording id of the FID node. -1 if not found
136-
*/
137-
nodeId?: number;
138-
}
139-
140-
export interface InteractionToNextPaintData {
141-
/**
142-
* Render time (in ms) of the INP
143-
*/
144-
value: number;
145-
size: number;
146-
/**
147-
* The recording id of the INP node. -1 if not found
148-
*/
149-
nodeId?: number;
150-
}
151-
152116
/**
153117
* Entries that come from window.performance
154118
*/

packages/replay-internal/test/unit/util/createPerformanceEntry.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ describe('Unit | util | createPerformanceEntries', () => {
152152
it('works with an CLS metric', async () => {
153153
const metric = {
154154
value: 5108.299,
155+
rating: 'good' as const,
155156
entries: [],
156157
};
157158

@@ -162,7 +163,7 @@ describe('Unit | util | createPerformanceEntries', () => {
162163
name: 'cumulative-layout-shift',
163164
start: 1672531205.108299,
164165
end: 1672531205.108299,
165-
data: { value: 5108.299, size: 5108.299, nodeId: undefined },
166+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
166167
});
167168
});
168169
});
@@ -171,6 +172,7 @@ describe('Unit | util | createPerformanceEntries', () => {
171172
it('works with an FID metric', async () => {
172173
const metric = {
173174
value: 5108.299,
175+
rating: 'good' as const,
174176
entries: [],
175177
};
176178

@@ -181,7 +183,7 @@ describe('Unit | util | createPerformanceEntries', () => {
181183
name: 'first-input-delay',
182184
start: 1672531205.108299,
183185
end: 1672531205.108299,
184-
data: { value: 5108.299, size: 5108.299, nodeId: undefined },
186+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
185187
});
186188
});
187189
});
@@ -190,6 +192,7 @@ describe('Unit | util | createPerformanceEntries', () => {
190192
it('works with an INP metric', async () => {
191193
const metric = {
192194
value: 5108.299,
195+
rating: 'good' as const,
193196
entries: [],
194197
};
195198

0 commit comments

Comments
 (0)