Skip to content

Commit 77a12ac

Browse files
committed
add tests
1 parent a83dcfd commit 77a12ac

5 files changed

Lines changed: 40 additions & 12 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
expectedFIDPerformanceSpan,
99
expectedFPPerformanceSpan,
1010
expectedLCPPerformanceSpan,
11+
expectedTTFBPerformanceSpan,
1112
expectedMemoryPerformanceSpan,
1213
expectedNavigationPerformanceSpan,
1314
getExpectedReplayEvent,
@@ -65,6 +66,7 @@ sentryTest(
6566
expectedNavigationPerformanceSpan,
6667
expectedLCPPerformanceSpan,
6768
expectedCLSPerformanceSpan,
69+
expectedTTFBPerformanceSpan,
6870
expectedFIDPerformanceSpan,
6971
expectedFPPerformanceSpan,
7072
expectedFCPPerformanceSpan,

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
expectedFIDPerformanceSpan,
99
expectedFPPerformanceSpan,
1010
expectedLCPPerformanceSpan,
11+
expectedTTFBPerformanceSpan,
1112
expectedMemoryPerformanceSpan,
1213
expectedNavigationBreadcrumb,
1314
expectedNavigationPerformanceSpan,
@@ -86,6 +87,7 @@ sentryTest(
8687
expectedNavigationPerformanceSpan,
8788
expectedLCPPerformanceSpan,
8889
expectedCLSPerformanceSpan,
90+
expectedTTFBPerformanceSpan,
8991
expectedFIDPerformanceSpan,
9092
expectedFPPerformanceSpan,
9193
expectedFCPPerformanceSpan,
@@ -126,6 +128,7 @@ sentryTest(
126128
expectedReloadPerformanceSpan,
127129
expectedLCPPerformanceSpan,
128130
expectedCLSPerformanceSpan,
131+
expectedTTFBPerformanceSpan,
129132
expectedFIDPerformanceSpan,
130133
expectedFPPerformanceSpan,
131134
expectedFCPPerformanceSpan,
@@ -195,6 +198,7 @@ sentryTest(
195198
expectedNavigationPerformanceSpan,
196199
expectedLCPPerformanceSpan,
197200
expectedCLSPerformanceSpan,
201+
expectedTTFBPerformanceSpan,
198202
expectedFIDPerformanceSpan,
199203
expectedFPPerformanceSpan,
200204
expectedFCPPerformanceSpan,
@@ -318,6 +322,7 @@ sentryTest(
318322
expectedNavigationPerformanceSpan,
319323
expectedLCPPerformanceSpan,
320324
expectedCLSPerformanceSpan,
325+
expectedTTFBPerformanceSpan,
321326
expectedFIDPerformanceSpan,
322327
expectedFPPerformanceSpan,
323328
expectedFCPPerformanceSpan,

dev-packages/browser-integration-tests/utils/replayEventTemplates.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ export const expectedLCPPerformanceSpan = {
127127
endTimestamp: expect.any(Number),
128128
data: {
129129
value: expect.any(Number),
130-
nodeId: expect.any(Number),
130+
nodeId: expect.any(Array),
131131
rating: expect.any(String),
132132
size: expect.any(Number),
133133
},
@@ -142,6 +142,7 @@ export const expectedCLSPerformanceSpan = {
142142
value: expect.any(Number),
143143
rating: expect.any(String),
144144
size: expect.any(Number),
145+
nodeId: expect.any(Array),
145146
},
146147
};
147148

@@ -154,7 +155,7 @@ export const expectedFIDPerformanceSpan = {
154155
value: expect.any(Number),
155156
rating: expect.any(String),
156157
size: expect.any(Number),
157-
nodeId: expect.any(Number),
158+
nodeId: expect.any(Array),
158159
},
159160
};
160161

@@ -167,11 +168,11 @@ export const expectedINPPerformanceSpan = {
167168
value: expect.any(Number),
168169
rating: expect.any(String),
169170
size: expect.any(Number),
170-
nodeId: expect.any(Number),
171+
nodeId: expect.any(Array),
171172
},
172173
};
173174

174-
export const expectedTTFB = {
175+
export const expectedTTFBPerformanceSpan = {
175176
op: 'web-vital',
176177
description: 'time-to-first-byte',
177178
startTimestamp: expect.any(Number),
@@ -180,7 +181,7 @@ export const expectedTTFB = {
180181
value: expect.any(Number),
181182
rating: expect.any(String),
182183
size: expect.any(Number),
183-
nodeId: expect.any(Number),
184+
nodeId: expect.any(Array),
184185
},
185186
};
186187

dev-packages/e2e-tests/test-applications/react-send-to-sentry/tests/fixtures/ReplayRecordingData.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,26 @@ export const ReplayRecordingData = [
220220
value: expect.any(Number),
221221
size: expect.any(Number),
222222
rating: expect.any(String),
223-
nodeId: 16,
223+
nodeId: [16],
224+
},
225+
},
226+
},
227+
},
228+
{
229+
type: 5,
230+
timestamp: expect.any(Number),
231+
data: {
232+
tag: 'performanceSpan',
233+
payload: {
234+
op: 'web-vital',
235+
description: 'time-to-first-byte',
236+
startTimestamp: expect.any(Number),
237+
endTimestamp: expect.any(Number),
238+
data: {
239+
value: expect.any(Number),
240+
size: expect.any(Number),
241+
rating: expect.any(String),
242+
nodeId: [],
224243
},
225244
},
226245
},
@@ -239,6 +258,7 @@ export const ReplayRecordingData = [
239258
value: expect.any(Number),
240259
size: expect.any(Number),
241260
rating: expect.any(String),
261+
nodeId: [],
242262
},
243263
},
244264
},
@@ -257,7 +277,7 @@ export const ReplayRecordingData = [
257277
value: expect.any(Number),
258278
size: expect.any(Number),
259279
rating: expect.any(String),
260-
nodeId: 10,
280+
nodeId: [10],
261281
},
262282
},
263283
},

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('Unit | util | createPerformanceEntries', () => {
8484
name: 'largest-contentful-paint',
8585
start: 1672531205.108299,
8686
end: 1672531205.108299,
87-
data: { value: 5108.299, rating: 'good', size: 5108.299, nodeId: undefined },
87+
data: { value: 5108.299, rating: 'good', size: 5108.299, nodeId: [] },
8888
});
8989
});
9090
});
@@ -104,7 +104,7 @@ describe('Unit | util | createPerformanceEntries', () => {
104104
name: 'cumulative-layout-shift',
105105
start: 1672531205.108299,
106106
end: 1672531205.108299,
107-
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
107+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: [] },
108108
});
109109
});
110110
});
@@ -124,7 +124,7 @@ describe('Unit | util | createPerformanceEntries', () => {
124124
name: 'first-input-delay',
125125
start: 1672531205.108299,
126126
end: 1672531205.108299,
127-
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
127+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: [] },
128128
});
129129
});
130130
});
@@ -144,7 +144,7 @@ describe('Unit | util | createPerformanceEntries', () => {
144144
name: 'interaction-to-next-paint',
145145
start: 1672531205.108299,
146146
end: 1672531205.108299,
147-
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
147+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: [] },
148148
});
149149
});
150150
});
@@ -164,7 +164,7 @@ describe('Unit | util | createPerformanceEntries', () => {
164164
name: 'time-to-first-byte',
165165
start: 1672531205.108299,
166166
end: 1672531205.108299,
167-
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: undefined },
167+
data: { value: 5108.299, size: 5108.299, rating: 'good', nodeId: [] },
168168
});
169169
});
170170
});

0 commit comments

Comments
 (0)