Skip to content

Commit

Permalink
Fix markdoc image tests (#7231)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored May 29, 2023
1 parent f2f18b4 commit df1e6f7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/integrations/markdoc/test/image-assets.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ describe('Markdoc - Image assets', () => {
const res = await baseFixture.fetch('/');
const html = await res.text();
const { document } = parseHTML(html);
expect(document.querySelector('#relative > img')?.src).to.equal(
'/_image?href=%2Fsrc%2Fassets%2Frelative%2Foar.jpg%3ForigWidth%3D420%26origHeight%3D630%26origFormat%3Djpg&f=webp'
expect(document.querySelector('#relative > img')?.src).to.match(
/\/_image\?href=.*%2Fsrc%2Fassets%2Frelative%2Foar.jpg%3ForigWidth%3D420%26origHeight%3D630%26origFormat%3Djpg&f=webp/
);
});

it('transforms aliased image paths to optimized path', async () => {
const res = await baseFixture.fetch('/');
const html = await res.text();
const { document } = parseHTML(html);
expect(document.querySelector('#alias > img')?.src).to.equal(
'/_image?href=%2Fsrc%2Fassets%2Falias%2Fcityscape.jpg%3ForigWidth%3D420%26origHeight%3D280%26origFormat%3Djpg&f=webp'
expect(document.querySelector('#alias > img')?.src).to.match(
/\/_image\?href=.*%2Fsrc%2Fassets%2Falias%2Fcityscape.jpg%3ForigWidth%3D420%26origHeight%3D280%26origFormat%3Djpg&f=webp/
);
});
});
Expand Down

0 comments on commit df1e6f7

Please sign in to comment.