Skip to content

Commit 49c2956

Browse files
committed
fix again
1 parent ef2632b commit 49c2956

File tree

4 files changed

+20
-14
lines changed
  • packages
    • browser-integration-tests/suites/replay/canvas
    • types/src

4 files changed

+20
-14
lines changed
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplaySnapshot, shouldSkipReplayTest } from '../../../../utils/replayHelpers';
4+
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({ getLocalTestUrl, page }) => {
7-
if (shouldSkipReplayTest()) {
7+
if (shouldSkipReplayTest() || (process.env.PW_BUNDLE || '').startsWith('bundle')) {
88
sentryTest.skip();
99
}
1010

11+
const reqPromise0 = waitForReplayRequest(page, 0);
12+
1113
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
1214
return route.fulfill({
1315
status: 200,
@@ -19,10 +21,11 @@ sentryTest('sets up canvas when adding ReplayCanvas integration first', async ({
1921
const url = await getLocalTestUrl({ testDir: __dirname });
2022

2123
await page.goto(url);
24+
await reqPromise0;
2225

2326
const replay = await getReplaySnapshot(page);
24-
const canvasOptions = replay._options._experiments?.canvas;
25-
expect(canvasOptions.fps).toBe(4);
26-
expect(canvasOptions.quality).toBe(0.6);
27+
const canvasOptions = replay._canvas;
28+
expect(canvasOptions?.sampling.canvas).toBe(2);
29+
expect(canvasOptions?.dataURLOptions.quality).toBe(0.4);
2730
expect(replay._hasCanvas).toBe(true);
2831
});
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplaySnapshot, shouldSkipReplayTest } from '../../../../utils/replayHelpers';
4+
import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', async ({ getLocalTestUrl, page }) => {
7-
if (shouldSkipReplayTest()) {
7+
if (shouldSkipReplayTest() || (process.env.PW_BUNDLE || '').startsWith('bundle')) {
88
sentryTest.skip();
99
}
1010

11+
const reqPromise0 = waitForReplayRequest(page, 0);
12+
1113
await page.route('https://dsn.ingest.sentry.io/**/*', route => {
1214
return route.fulfill({
1315
status: 200,
@@ -19,10 +21,11 @@ sentryTest('sets up canvas when adding ReplayCanvas integration after Replay', a
1921
const url = await getLocalTestUrl({ testDir: __dirname });
2022

2123
await page.goto(url);
24+
await reqPromise0;
2225

2326
const replay = await getReplaySnapshot(page);
24-
const canvasOptions = replay._options._experiments?.canvas;
25-
expect(canvasOptions.fps).toBe(4);
26-
expect(canvasOptions.quality).toBe(0.6);
27+
const canvasOptions = replay._canvas;
28+
expect(canvasOptions?.sampling.canvas).toBe(2);
29+
expect(canvasOptions?.dataURLOptions.quality).toBe(0.4);
2730
expect(replay._hasCanvas).toBe(true);
2831
});

packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sentryTest('does not setup up canvas without ReplayCanvas integration', async ({
2121
await page.goto(url);
2222

2323
const replay = await getReplaySnapshot(page);
24-
const canvasOptions = replay._options._experiments?.canvas;
24+
const canvasOptions = replay._canvas;
2525
expect(canvasOptions).toBe(undefined);
2626
expect(replay._hasCanvas).toBe(false);
2727
});

packages/types/src/client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,13 @@ export interface Client<O extends ClientOptions = ClientOptions> {
138138
*/
139139
getEventProcessors?(): EventProcessor[];
140140

141-
/**
141+
/**
142142
* Returns the client's instance of the given integration class, it any.
143143
* @deprecated Use `getIntegrationByName()` instead.
144144
*/
145-
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
145+
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
146146

147-
/** Get the instance of the integration with the given name on the client, if it was added. */
147+
/** Get the instance of the integration with the given name on the client, if it was added. */
148148
getIntegrationByName?<T extends Integration = Integration>(name: string): T | undefined;
149149

150150
/**

0 commit comments

Comments
 (0)