Skip to content

Commit 191e7b6

Browse files
committed
rework integration test changes
1 parent 2889cd0 commit 191e7b6

File tree

2 files changed

+7
-16
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/metrics

2 files changed

+7
-16
lines changed

dev-packages/browser-integration-tests/suites/tracing/metrics/web-vitals-fid/test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
2+
import type { SerializedEvent } from '@sentry/types';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -16,17 +16,14 @@ sentryTest('should capture a FID vital.', async ({ browserName, getLocalTestPath
1616
// To trigger FID
1717
await page.click('#fid-btn');
1818

19-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page);
19+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page);
2020

2121
expect(eventData.measurements).toBeDefined();
2222
expect(eventData.measurements?.fid?.value).toBeDefined();
2323

24-
// eslint-disable-next-line deprecation/deprecation
2524
const fidSpan = eventData.spans?.filter(({ description }) => description === 'first input delay')[0];
2625

2726
expect(fidSpan).toBeDefined();
28-
// eslint-disable-next-line deprecation/deprecation
2927
expect(fidSpan?.op).toBe('ui.action');
30-
// @ts-expect-error this property is not defined on Event
3128
expect(fidSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
3229
});
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Event } from '@sentry/types';
2+
import type { SerializedEvent } from '@sentry/types';
33

44
import { sentryTest } from '../../../../utils/fixtures';
55
import { getFirstSentryEnvelopeRequest, shouldSkipTracingTest } from '../../../../utils/helpers';
@@ -11,19 +11,16 @@ sentryTest('should capture FP vital.', async ({ browserName, getLocalTestPath, p
1111
}
1212

1313
const url = await getLocalTestPath({ testDir: __dirname });
14-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
14+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
1515

1616
expect(eventData.measurements).toBeDefined();
1717
expect(eventData.measurements?.fp?.value).toBeDefined();
1818

19-
// eslint-disable-next-line deprecation/deprecation
2019
const fpSpan = eventData.spans?.filter(({ description }) => description === 'first-paint')[0];
2120

2221
expect(fpSpan).toBeDefined();
23-
// eslint-disable-next-line deprecation/deprecation
2422
expect(fpSpan?.op).toBe('paint');
25-
// @ts-expect-error this property is not defined on Event
26-
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace.span_id);
23+
expect(fpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
2724
});
2825

2926
sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
@@ -32,17 +29,14 @@ sentryTest('should capture FCP vital.', async ({ getLocalTestPath, page }) => {
3229
}
3330

3431
const url = await getLocalTestPath({ testDir: __dirname });
35-
const eventData = await getFirstSentryEnvelopeRequest<Event>(page, url);
32+
const eventData = await getFirstSentryEnvelopeRequest<SerializedEvent>(page, url);
3633

3734
expect(eventData.measurements).toBeDefined();
3835
expect(eventData.measurements?.fcp?.value).toBeDefined();
3936

40-
// eslint-disable-next-line deprecation/deprecation
4137
const fcpSpan = eventData.spans?.filter(({ description }) => description === 'first-contentful-paint')[0];
4238

4339
expect(fcpSpan).toBeDefined();
44-
// eslint-disable-next-line deprecation/deprecation
4540
expect(fcpSpan?.op).toBe('paint');
46-
// @ts-expect-error this property is not defined on Event
47-
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace.span_id);
41+
expect(fcpSpan?.parent_span_id).toBe(eventData.contexts?.trace?.span_id);
4842
});

0 commit comments

Comments
 (0)