diff --git a/lib/__tests__/push-preview-route-ambiguous.test.ts b/lib/__tests__/push-preview-route-ambiguous.test.ts index 156aa9c1e..782aff8ce 100644 --- a/lib/__tests__/push-preview-route-ambiguous.test.ts +++ b/lib/__tests__/push-preview-route-ambiguous.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { beforeAll, describe, it, expect, vi, beforeEach } from 'vitest'; // The push names only the JMAP account id, and ids repeat: Stalwart numbers // accounts alike on every install, and a group account is listed in the @@ -93,6 +93,12 @@ async function callRoute(accountId: string, login?: string) { const mailCalls = () => fetchJmapServer.mock.calls.filter(([url]) => !url.endsWith('/.well-known/jmap')); +// The route's first import can take longer than a test's limit on a busy machine, +// and a test that times out keeps running into the next one's state. +beforeAll(async () => { + await import('@/app/api/push/preview/route'); +}, 60_000); + describe('push preview after the browser was closed', () => { it('reads the login from the remembered session when the context cookie is gone', async () => { remembered.value = { serverUrl: 'https://one.example', authHeader: 'Basic remembered', username: 'alice@one.example' };