From 64c3d7e384cc452071c38071e0ad6c3c13a2762b Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 21 Mar 2026 16:33:53 +0100 Subject: [PATCH] fix: update getContacts test to use mockFetchOnce --- lib/__tests__/jmap-contact-client.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/__tests__/jmap-contact-client.test.ts b/lib/__tests__/jmap-contact-client.test.ts index 7a054a6f..ec1aea62 100644 --- a/lib/__tests__/jmap-contact-client.test.ts +++ b/lib/__tests__/jmap-contact-client.test.ts @@ -122,10 +122,15 @@ describe('JMAPClient contact methods', () => { describe('getContacts', () => { it('should return contacts from server', async () => { const client = createClient(); - mockFetch({ + const spy = vi.spyOn(globalThis, 'fetch'); + mockFetchOnce(spy, { methodResponses: [ - ['ContactCard/query', { ids: ['contact-1'] }, '0'], - ['ContactCard/get', { list: [mockContact] }, '1'], + ['ContactCard/query', { ids: ['contact-1'] }, 'q'], + ], + }); + mockFetchOnce(spy, { + methodResponses: [ + ['ContactCard/get', { list: [mockContact] }, 'g'], ], });