Skip to content

Commit

Permalink
Test: Add captureAssets config to meta event
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 committed Nov 30, 2023
1 parent 21e51b9 commit 51b4b56
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions packages/rrweb/test/record/asset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,30 @@ describe('asset caching', function (this: ISuite) {
},
);

it('adds captureAssets config to meta event', async () => {
await ctx.page.waitForNetworkIdle({ idleTime: 100 });
await waitForRAF(ctx.page);

const events = await ctx.page?.evaluate(
() => (window as unknown as IWindow).snapshots,
);

expect(events).toContainEqual(
expect.objectContaining({
type: EventType.Meta,
data: {
href: expect.any(String),
width: expect.any(Number),
height: expect.any(Number),
captureAssets: {
origins: true,
objectURLs: false,
},
},
}),
);
});

it('capture all urls', async () => {
await ctx.page.waitForNetworkIdle({ idleTime: 100 });
await waitForRAF(ctx.page);
Expand Down

0 comments on commit 51b4b56

Please sign in to comment.