Files
sendou.ink/app/features/dev-tools/dev-tools-search-params.test.ts
Kalle f7372324fe
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled
E2E Tests / publish-docs-screenshots (push) Has been cancelled
Dev tools (#3471)
2026-10-25 11:43:36 +02:00

27 lines
663 B
TypeScript

import { describe, test } from "vitest";
import {
assertDecodesToDefault,
assertRoundTrips,
} from "~/modules/search-params/search-params-test-utils";
import { logInAsSearchParams } from "./dev-tools-search-params";
describe("logInAsSearchParams", () => {
test("round-trips", () => {
assertRoundTrips(logInAsSearchParams, {
userId: [null, 1, 274],
returnTo: [null, "/", "/q/match/5?tab=chat"],
});
});
test("garbage decodes to default", () => {
assertDecodesToDefault(logInAsSearchParams, "userId", [
["abc"],
["0"],
["1.5"],
]);
assertDecodesToDefault(logInAsSearchParams, "returnTo", [
["https://example.com"],
]);
});
});