import { describe, expect, it, vi } from 'vitest'; const invokeIpcMock = vi.hoisted(() => vi.fn(async () => undefined)); vi.mock('@/lib/api-client', () => ({ invokeIpc: (...args: unknown[]) => invokeIpcMock(...args), })); import { openWorksSquareSubscriptionUpgrade, WORKS_SQUARE_UPGRADE_URL } from '@/lib/subscription-upgrade'; describe('subscription upgrade helpers', () => { it('opens the Works Square subscription page', async () => { await openWorksSquareSubscriptionUpgrade(); expect(WORKS_SQUARE_UPGRADE_URL).toBe('https://square.nianxx.cn/#profile'); expect(invokeIpcMock).toHaveBeenCalledWith( 'shell:openExternal', 'https://square.nianxx.cn/#profile', ); }); });