test(notifications) : mock local storage for push subscription tests
CI / Verify (push) Successful in 1m53s
CI / Build immutable images and deploy (push) Successful in 2m48s

This commit is contained in:
2026-10-08 18:57:09 +07:00 Unverified
parent da5de3fa8c
commit 5747ddb42c
+2 -1
View File
@@ -1,5 +1,6 @@
import { afterEach, describe, expect, it, vi } from 'vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { syncSitePush } from '@/components/notifications/push-client'; import { syncSitePush } from '@/components/notifications/push-client';
beforeEach(() => vi.stubGlobal('localStorage', { getItem: vi.fn().mockReturnValue(null) }));
afterEach(() => vi.unstubAllGlobals()); afterEach(() => vi.unstubAllGlobals());
describe('shared site push subscriptions', () => { describe('shared site push subscriptions', () => {
for (const admin of [false, true]) it(`registers comments and commission with one ${admin ? 'admin' : 'customer'} browser subscription`, async () => { for (const admin of [false, true]) it(`registers comments and commission with one ${admin ? 'admin' : 'customer'} browser subscription`, async () => {