1
0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-05-25 11:46:10 +02:00

Adapt mock and add workspace test with websocket mock

This commit is contained in:
Belén Albeza 2024-05-03 14:52:58 +02:00 committed by AzazelN28
parent 30321e54f0
commit 3bae6e4661
19 changed files with 347 additions and 132 deletions
frontend/playwright/helpers

View file

@ -0,0 +1,17 @@
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}`,
}),
);