mirror of
https://github.com/penpot/penpot.git
synced 2025-05-09 20:36:38 +02:00
💄 Reformat affected JS files
This commit is contained in:
parent
3efd5cb9e8
commit
ecbedf847f
28 changed files with 720 additions and 285 deletions
|
@ -14,12 +14,17 @@ export class MockWebSocketHelper extends EventTarget {
|
|||
}
|
||||
this.#mocks.get(url).dispatchEvent(new MessageEvent("message", { data }));
|
||||
});
|
||||
await page.exposeFunction("onMockWebSocketSpyClose", (url, code, reason) => {
|
||||
if (!this.#mocks.has(url)) {
|
||||
throw new Error(`WebSocket with URL ${url} not found`);
|
||||
}
|
||||
this.#mocks.get(url).dispatchEvent(new CloseEvent("close", { code, reason }));
|
||||
});
|
||||
await page.exposeFunction(
|
||||
"onMockWebSocketSpyClose",
|
||||
(url, code, reason) => {
|
||||
if (!this.#mocks.has(url)) {
|
||||
throw new Error(`WebSocket with URL ${url} not found`);
|
||||
}
|
||||
this.#mocks
|
||||
.get(url)
|
||||
.dispatchEvent(new CloseEvent("close", { code, reason }));
|
||||
},
|
||||
);
|
||||
await page.addInitScript({ path: "playwright/scripts/MockWebSocket.js" });
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue