fix: update getContacts test to use mockFetchOnce

This commit is contained in:
Linus Rath
2026-03-21 20:45:20 +01:00
parent e6d09546b1
commit 64c3d7e384
+8 -3
View File
@@ -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'],
],
});