mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-11-12 22:29:53 -06:00
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
27 lines
663 B
TypeScript
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"],
|
|
]);
|
|
});
|
|
});
|