Skip to content

Commit

Permalink
test: ensure fetch is called with correct URL and headers in user syn…
Browse files Browse the repository at this point in the history
…c API

Co-Authored-By: Natalia Rodrigues <Natytotherodrigues@gmail.com>
  • Loading branch information
GabrielSMonteiro and Natyrodrigues committed Sep 19, 2024
1 parent b3aa11c commit dcaaa39
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/app/__tests__/watermelon.service.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,15 @@ describe('syncDatabaseWithServer', () => {
})
})
);

expect(fetch).toHaveBeenCalledWith(
expect.stringMatching(/\/api\/usuario\/sync\/pull_users\?lastPulledAt=0&schemaVersion=1&migration=1/),
expect.objectContaining({
method: 'GET',
headers: expect.objectContaining({
Authorization: `Bearer ${mockToken}`
})
})
);
});
});

0 comments on commit dcaaa39

Please sign in to comment.