test: tighten web push subscription assertion

This commit is contained in:
Peter Steinberger
2026-05-09 04:12:44 +01:00
parent dcf3c851f0
commit 067dda2f26

View File

@@ -37,10 +37,10 @@ vi.mock("web-push", () => ({
function expectLoadedSubscription(
loaded: Awaited<ReturnType<typeof loadWebPushSubscription>>,
): WebPushSubscription {
expect(loaded).toEqual(expect.objectContaining({ endpoint: expect.any(String) }));
if (loaded === null) {
throw new Error("Expected loaded web push subscription");
}
expect(loaded.endpoint).not.toBe("");
return loaded;
}