mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-15 00:11:15 +03:00
apply prettier fixes to new e2e files
This commit is contained in:
parent
91c5b1b785
commit
741c5abdc3
@ -32,7 +32,10 @@ function isAllowlisted(message: string, allowlist: RegExp[]): boolean {
|
|||||||
|
|
||||||
function firstStackFrame(stack: string | undefined): string | undefined {
|
function firstStackFrame(stack: string | undefined): string | undefined {
|
||||||
if (!stack) return undefined;
|
if (!stack) return undefined;
|
||||||
const lines = stack.split("\n").map((l) => l.trim()).filter(Boolean);
|
const lines = stack
|
||||||
|
.split("\n")
|
||||||
|
.map((l) => l.trim())
|
||||||
|
.filter(Boolean);
|
||||||
// Skip the error message line (line 0); return the first "at ..." frame
|
// Skip the error message line (line 0); return the first "at ..." frame
|
||||||
return lines.find((l) => l.startsWith("at "));
|
return lines.find((l) => l.startsWith("at "));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,10 +22,7 @@ import {
|
|||||||
type ApiMockOverrides,
|
type ApiMockOverrides,
|
||||||
} from "../helpers/api-mocker";
|
} from "../helpers/api-mocker";
|
||||||
import { WsMocker } from "../helpers/ws-mocker";
|
import { WsMocker } from "../helpers/ws-mocker";
|
||||||
import {
|
import { installErrorCollector, type ErrorCollector } from "./error-collector";
|
||||||
installErrorCollector,
|
|
||||||
type ErrorCollector,
|
|
||||||
} from "./error-collector";
|
|
||||||
import { GLOBAL_ALLOWLIST } from "./error-allowlist";
|
import { GLOBAL_ALLOWLIST } from "./error-allowlist";
|
||||||
|
|
||||||
export class FrigateApp {
|
export class FrigateApp {
|
||||||
|
|||||||
@ -21,9 +21,7 @@ export async function mockEmpty(
|
|||||||
page: Page,
|
page: Page,
|
||||||
urlPattern: string | RegExp,
|
urlPattern: string | RegExp,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await page.route(urlPattern, (route) =>
|
await page.route(urlPattern, (route) => route.fulfill({ json: [] }));
|
||||||
route.fulfill({ json: [] }),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return an HTTP error for the matched endpoint. Default status 500. */
|
/** Return an HTTP error for the matched endpoint. Default status 500. */
|
||||||
|
|||||||
@ -123,7 +123,7 @@ export class BasePage {
|
|||||||
if (this.isDesktop) {
|
if (this.isDesktop) {
|
||||||
return this.pageRoot;
|
return this.pageRoot;
|
||||||
}
|
}
|
||||||
return this.page.locator('[vaul-drawer]').first();
|
return this.page.locator("[vaul-drawer]").first();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Close any currently-open mobile overlay (drawer, sheet, dialog). */
|
/** Close any currently-open mobile overlay (drawer, sheet, dialog). */
|
||||||
|
|||||||
@ -4,11 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { test, expect } from "../../fixtures/frigate-test";
|
import { test, expect } from "../../fixtures/frigate-test";
|
||||||
import {
|
import { mockEmpty, mockError, mockDelay } from "../../helpers/mock-overrides";
|
||||||
mockEmpty,
|
|
||||||
mockError,
|
|
||||||
mockDelay,
|
|
||||||
} from "../../helpers/mock-overrides";
|
|
||||||
|
|
||||||
test.describe("Mock Overrides — empty @meta", () => {
|
test.describe("Mock Overrides — empty @meta", () => {
|
||||||
test("mockEmpty returns []", async ({ page, frigateApp }) => {
|
test("mockEmpty returns []", async ({ page, frigateApp }) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user