Skip to content

Commit 9e8e3fd

Browse files
committed
move around replay snapshots
1 parent b4bc852 commit 9e8e3fd

File tree

2 files changed

+11
-11
lines changed
  • dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch

2 files changed

+11
-11
lines changed

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,14 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
3737
const url = await getLocalTestPath({ testDir: __dirname });
3838
await page.goto(url);
3939

40-
const [, request, { replayRecordingSnapshots }] = await Promise.all([
40+
const [, request] = await Promise.all([
4141
page.evaluate(() => {
4242
fetch('http://localhost:7654/foo').then(() => {
4343
// @ts-expect-error Sentry is a global
4444
Sentry.captureException('test error');
4545
});
4646
}),
4747
requestPromise,
48-
replayRequestPromise,
4948
]);
5049

5150
const eventData = envelopeRequestParser(request);
@@ -64,6 +63,7 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
6463
},
6564
});
6665

66+
const { replayRecordingSnapshots } = await replayRequestPromise;
6767
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
6868
{
6969
data: {
@@ -113,15 +113,14 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
113113
const url = await getLocalTestPath({ testDir: __dirname });
114114
await page.goto(url);
115115

116-
const [, request, { replayRecordingSnapshots }] = await Promise.all([
116+
const [, request] = await Promise.all([
117117
page.evaluate(() => {
118118
fetch('http://localhost:7654/foo').then(() => {
119119
// @ts-expect-error Sentry is a global
120120
Sentry.captureException('test error');
121121
});
122122
}),
123123
requestPromise,
124-
replayRequestPromise,
125124
]);
126125

127126
const eventData = envelopeRequestParser(request);
@@ -140,6 +139,7 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
140139
},
141140
});
142141

142+
const { replayRecordingSnapshots } = await replayRequestPromise;
143143
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
144144
{
145145
data: {
@@ -195,15 +195,14 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
195195
const url = await getLocalTestPath({ testDir: __dirname });
196196
await page.goto(url);
197197

198-
const [, request, { replayRecordingSnapshots }] = await Promise.all([
198+
const [, request] = await Promise.all([
199199
page.evaluate(() => {
200200
fetch('http://localhost:7654/bar').then(() => {
201201
// @ts-expect-error Sentry is a global
202202
Sentry.captureException('test error');
203203
});
204204
}),
205205
requestPromise,
206-
replayRequestPromise,
207206
]);
208207

209208
const eventData = envelopeRequestParser(request);
@@ -222,6 +221,7 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
222221
},
223222
});
224223

224+
const { replayRecordingSnapshots } = await replayRequestPromise;
225225
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
226226
{
227227
data: {

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sentryTest('captures response size from Content-Length header if available', asy
4343
const url = await getLocalTestPath({ testDir: __dirname });
4444
await page.goto(url);
4545

46-
const [, request, { replayRecordingSnapshots }] = await Promise.all([
46+
const [, request ] = await Promise.all([
4747
page.evaluate(() => {
4848
/* eslint-disable */
4949
fetch('http://localhost:7654/foo').then(() => {
@@ -53,7 +53,6 @@ sentryTest('captures response size from Content-Length header if available', asy
5353
/* eslint-enable */
5454
}),
5555
requestPromise,
56-
replayRequestPromise,
5756
]);
5857

5958
const eventData = envelopeRequestParser(request);
@@ -73,6 +72,7 @@ sentryTest('captures response size from Content-Length header if available', asy
7372
},
7473
});
7574

75+
const { replayRecordingSnapshots } = await replayRequestPromise;
7676
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
7777
{
7878
data: {
@@ -135,7 +135,7 @@ sentryTest('captures response size without Content-Length header', async ({ getL
135135
const url = await getLocalTestPath({ testDir: __dirname });
136136
await page.goto(url);
137137

138-
const [, request, { replayRecordingSnapshots }] = await Promise.all([
138+
const [, request] = await Promise.all([
139139
page.evaluate(() => {
140140
/* eslint-disable */
141141
fetch('http://localhost:7654/foo').then(() => {
@@ -145,7 +145,6 @@ sentryTest('captures response size without Content-Length header', async ({ getL
145145
/* eslint-enable */
146146
}),
147147
requestPromise,
148-
replayRequestPromise,
149148
]);
150149

151150
const eventData = envelopeRequestParser(request);
@@ -163,8 +162,9 @@ sentryTest('captures response size without Content-Length header', async ({ getL
163162
// NOT set here from body, as this would be async
164163
url: 'http://localhost:7654/foo',
165164
},
166-
});
165+
})
167166

167+
const { replayRecordingSnapshots } = await replayRequestPromise;
168168
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
169169
{
170170
data: {

0 commit comments

Comments
 (0)