Skip to content

Commit

Permalink
fix: update recon tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Jul 31, 2024
1 parent e3b5ba0 commit 1f83f85
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/core/src/__tests__/recon.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ describe('ReconApi', () => {
const fakeInterest1 = TestUtils.randomStreamID()
await reconApi.init('testInitialCursor', [fakeInterest0, fakeInterest1])
expect(mockSendRequest).toHaveBeenCalledTimes(4)
expect(mockSendRequest.mock.calls[2][0]).toContain(fakeInterest0.toString())
expect(mockSendRequest.mock.calls[3][0]).toContain(fakeInterest1.toString())
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: fakeInterest0.toString() }, headers: { 'Content-Type': 'application/json' } }
)
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: fakeInterest1.toString() }, headers: { 'Content-Type': 'application/json' } }
)
reconApi.stop()
})
})
Expand All @@ -115,8 +121,8 @@ describe('ReconApi', () => {
test('should be able to register interest in a model', async () => {
await reconApi.registerInterest(MODEL)
expect(mockSendRequest).toHaveBeenCalledWith(
`${RECON_URL}/ceramic/interests/model/${MODEL.toString()}`,
{ method: 'POST', body: {}, headers: { 'Content-Type': 'application/json' } }
`${RECON_URL}/ceramic/interests`,
{ method: 'POST', body: { sep: "model", sepValue: MODEL.toString() }, headers: { 'Content-Type': 'application/json' } }
)
})
})
Expand Down

0 comments on commit 1f83f85

Please sign in to comment.