Files
kandev/apps/web/e2e/helpers/wait-for-mutation.ts
T
2026-07-19 14:21:36 +01:00

9 lines
304 B
TypeScript

import type { Page } from "@playwright/test";
export function waitForMutation(page: Page, method: string, path: RegExp) {
return page.waitForResponse((response) => {
const request = response.request();
return request.method() === method && path.test(new URL(response.url()).pathname);
});
}