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:
parent
30321e54f0
commit
3bae6e4661
19 changed files with 347 additions and 132 deletions
frontend/playwright/helpers
17
frontend/playwright/helpers/MockAPI.js
Normal file
17
frontend/playwright/helpers/MockAPI.js
Normal 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}`,
|
||||
}),
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue