diff --git a/tests/postgres/webhooks.spec.ts b/tests/postgres/webhooks.spec.ts index 2e1fa8c7..370da106 100644 --- a/tests/postgres/webhooks.spec.ts +++ b/tests/postgres/webhooks.spec.ts @@ -55,13 +55,12 @@ async function logEvent(type: string, userId: string, metadata: Record { it('starts after the newest event, then delivers each new one once, signed', async () => { + // Logged while no endpoint exists: the first endpoint starts after it, so it is not replayed. + await logEvent('user_deleted', '11111111-1111-4111-8111-111111111111'); const { secret } = await createEndpoint( { url: `http://127.0.0.1:${port}/hook`, eventTypes: ['user.deleted'] }, null, ); - - // Before the cursor exists: history is not replayed. - await logEvent('user_deleted', '11111111-1111-4111-8111-111111111111'); expect(await dispatchWebhooks()).toBe(0); await logEvent('user_deleted', '22222222-2222-4222-8222-222222222222');