test(notifications) : mock local storage for push subscription tests
This commit is contained in:
@@ -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 () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user