mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 00:10:11 -05:00
17 lines
510 B
JavaScript
17 lines
510 B
JavaScript
export const interceptRPC = (page, path, jsonFilename) =>
|
|
page.route(`**/api/rpc/command/${path}`, (route) =>
|
|
route.fulfill({
|
|
status: 200,
|
|
contentType: "application/transit+json",
|
|
path: `playwright/fixtures/${jsonFilename}`,
|
|
}),
|
|
);
|
|
|
|
export const interceptRPCByRegex = (page, regex, jsonFilename) =>
|
|
page.route(regex, (route) =>
|
|
route.fulfill({
|
|
status: 200,
|
|
contentType: "application/transit+json",
|
|
path: `playwright/fixtures/${jsonFilename}`,
|
|
}),
|
|
);
|