1import { formatPushPolicy } from "./push.ts";23function assertEquals(actual: string, expected: string): void {4 if (actual !== expected) throw new Error(`expected ${expected}, got ${actual}`);5}67function assertStringIncludes(actual: string, expected: string): void {8 if (!actual.includes(expected)) {9 throw new Error(`expected ${JSON.stringify(actual)} to include ${JSON.stringify(expected)}`);10 }11}1213Deno.test("push feedback reports permanent password protection", () => {14 assertEquals(formatPushPolicy(null, true), "forever, password protected");15});1617Deno.test("push feedback reports finite expiry without password protection", () => {18 assertStringIncludes(19 formatPushPolicy(Math.floor(Date.now() / 1000) + 86_400, false),20 "expires in 1d, no password",21 );22});