Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created December 15, 2024 13:00
Show Gist options
  • Save YonatanKra/01ad8b949a0de229231084cd6fae3e53 to your computer and use it in GitHub Desktop.
Save YonatanKra/01ad8b949a0de229231084cd6fae3e53 to your computer and use it in GitHub Desktop.
it('should return the post with altLess images list', async () => {
const imageWithoutAlt = { alt: '' };
const imageWithAlt = { alt: 'I have Alt text!' };
const post = {
uri: 'postUri',
cid: 'postCid',
value: {
embed: {
images: [imageWithoutAlt, imageWithAlt, imageWithoutAlt],
$type: 'image'
},
text: '',
createdAt: ''
},
};
mockAtpAgent.getPost.mockResolvedValueOnce(post);
const result = await bot.checkSinglePost(postUri);
expect(result).toEqual({ post, imagesWithoutAlt: [imageWithoutAlt, imageWithoutAlt] })
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment