mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-08 06:22:31 -05:00
21 lines
569 B
TypeScript
21 lines
569 B
TypeScript
import { describe, it } from "vitest";
|
|
import {
|
|
assertDecodesToDefault,
|
|
assertRoundTrips,
|
|
} from "~/modules/persisted-state/persisted-state-test-utils";
|
|
import { recentlyReportedWeaponsPersisted } from "./useRecentlyReportedWeapons";
|
|
|
|
describe("recentlyReportedWeaponsPersisted", () => {
|
|
it("round-trips", () => {
|
|
assertRoundTrips(recentlyReportedWeaponsPersisted, [[], [0, 10, 8000]]);
|
|
});
|
|
|
|
it("malformed values decode to the default", () => {
|
|
assertDecodesToDefault(recentlyReportedWeaponsPersisted, [
|
|
"not json",
|
|
"[99999]",
|
|
'["0"]',
|
|
]);
|
|
});
|
|
});
|