fix: update getContacts test to use mockFetchOnce
This commit is contained in:
@@ -122,10 +122,15 @@ describe('JMAPClient contact methods', () => {
|
|||||||
describe('getContacts', () => {
|
describe('getContacts', () => {
|
||||||
it('should return contacts from server', async () => {
|
it('should return contacts from server', async () => {
|
||||||
const client = createClient();
|
const client = createClient();
|
||||||
mockFetch({
|
const spy = vi.spyOn(globalThis, 'fetch');
|
||||||
|
mockFetchOnce(spy, {
|
||||||
methodResponses: [
|
methodResponses: [
|
||||||
['ContactCard/query', { ids: ['contact-1'] }, '0'],
|
['ContactCard/query', { ids: ['contact-1'] }, 'q'],
|
||||||
['ContactCard/get', { list: [mockContact] }, '1'],
|
],
|
||||||
|
});
|
||||||
|
mockFetchOnce(spy, {
|
||||||
|
methodResponses: [
|
||||||
|
['ContactCard/get', { list: [mockContact] }, 'g'],
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user