Files
buzz-sheet/lib/commission/push.test.ts
T
gunshiz 3473b55768
CI / Verify (push) Successful in 1m48s
CI / Build immutable images and deploy (push) Successful in 2m47s
feat(commission) : add push notifications and unread ticket titles
2026-10-02 11:51:05 +07:00

16 lines
781 B
TypeScript

import { describe, expect, it, vi } from "vitest";
vi.mock("server-only", () => ({}));
const { validPushEndpoint } = await import("./push");
describe("commission push endpoints", () => {
it("accepts browser push services and rejects arbitrary destinations", () => {
expect(validPushEndpoint("https://fcm.googleapis.com/fcm/send/token")).toBe(true);
expect(validPushEndpoint("https://updates.push.services.mozilla.com/wpush/v2/token")).toBe(true);
expect(validPushEndpoint("https://web.push.apple.com/token")).toBe(true);
expect(validPushEndpoint("https://127.0.0.1/push")).toBe(false);
expect(validPushEndpoint("https://fcm.googleapis.com.evil.test/push")).toBe(false);
expect(validPushEndpoint("http://fcm.googleapis.com/push")).toBe(false);
});
});