Makelore 2.0 initial clean snapshot
This commit is contained in:
21
tests/unit/subscription-upgrade.test.ts
Normal file
21
tests/unit/subscription-upgrade.test.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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',
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user