Created
December 21, 2024 04:44
-
-
Save YonatanKra/7c52b72d946be1b1f3ec1ac3213d72e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should send parsed output to the callback', async () => { | |
queueAgentFeedResponse(fullFeedResponseWithAlt); | |
queueAgentFeedResponse(fullFeedLastResponse); | |
const spy = vi.fn(); | |
await bot.run(handle, 'password', spy); | |
expect(spy.mock.calls[0][0]).toEqual({ | |
results: [ | |
{ | |
imagesWithoutAlt: [], | |
text: 'text1', | |
createdAt: fullFeedResponseWithAlt.data.feed[0].post.record?.createdAt | |
}, | |
{ | |
imagesWithoutAlt: [], | |
text: 'text2', | |
createdAt: fullFeedResponseWithAlt.data.feed[1].post.record?.createdAt }, | |
], | |
done: false | |
}); | |
expect(spy.mock.calls[1][0]).toEqual({ | |
results: [ | |
{ | |
imagesWithoutAlt: [imageWithoutAlt, imageWithoutAlt], | |
text: 'text1', | |
createdAt: fullFeedLastResponse.data.feed[0].post.record?.createdAt | |
}, | |
{ | |
imagesWithoutAlt: [imageWithoutAlt, imageWithoutAlt], | |
text: 'text2', | |
createdAt: fullFeedLastResponse.data.feed[1].post.record?.createdAt }, | |
], | |
done: true | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment