mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* abort all requests for external resources and single mock for text ad * render and mockApiResponse fixtures * move fixtures into separate files * rewrite Blocks test * refactor mockApiResponse signature * test with auth * rewrite test with other API domains * fix test * separate script for installing deps in pw docker
16 lines
405 B
TypeScript
16 lines
405 B
TypeScript
import type { TestFixture, Page } from '@playwright/test';
|
|
|
|
export type MockAssetResponseFixture = (url: string, path: string) => Promise<void>;
|
|
|
|
const fixture: TestFixture<MockAssetResponseFixture, { page: Page }> = async({ page }, use) => {
|
|
await use(async(url, path) => {
|
|
|
|
await page.route(url, (route) => route.fulfill({
|
|
status: 200,
|
|
path,
|
|
}));
|
|
});
|
|
};
|
|
|
|
export default fixture;
|