mirror of
https://github.com/penpot/penpot.git
synced 2025-05-18 05:06:10 +02:00
💄 Reformat affected JS files
This commit is contained in:
parent
3efd5cb9e8
commit
ecbedf847f
28 changed files with 720 additions and 285 deletions
frontend/playwright/scripts
|
@ -188,13 +188,18 @@ window.WebSocket = class MockWebSocket extends EventTarget {
|
|||
|
||||
mockClose(code, reason) {
|
||||
this.#readyState = MockWebSocket.CLOSED;
|
||||
this.dispatchEvent(new CloseEvent("close", { code: code || 1000, reason: reason || "" }));
|
||||
this.dispatchEvent(
|
||||
new CloseEvent("close", { code: code || 1000, reason: reason || "" }),
|
||||
);
|
||||
return this;
|
||||
}
|
||||
|
||||
send(data) {
|
||||
if (this.#readyState === MockWebSocket.CONNECTING) {
|
||||
throw new DOMException("InvalidStateError", "MockWebSocket is not connected");
|
||||
throw new DOMException(
|
||||
"InvalidStateError",
|
||||
"MockWebSocket is not connected",
|
||||
);
|
||||
}
|
||||
|
||||
if (this.#spyMessage) {
|
||||
|
@ -203,7 +208,12 @@ window.WebSocket = class MockWebSocket extends EventTarget {
|
|||
}
|
||||
|
||||
close(code, reason) {
|
||||
if (code && !Number.isInteger(code) && code !== 1000 && (code < 3000 || code > 4999)) {
|
||||
if (
|
||||
code &&
|
||||
!Number.isInteger(code) &&
|
||||
code !== 1000 &&
|
||||
(code < 3000 || code > 4999)
|
||||
) {
|
||||
throw new DOMException("InvalidAccessError", "Invalid code");
|
||||
}
|
||||
|
||||
|
@ -214,7 +224,9 @@ window.WebSocket = class MockWebSocket extends EventTarget {
|
|||
}
|
||||
}
|
||||
|
||||
if ([MockWebSocket.CLOSED, MockWebSocket.CLOSING].includes(this.#readyState)) {
|
||||
if (
|
||||
[MockWebSocket.CLOSED, MockWebSocket.CLOSING].includes(this.#readyState)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue