Skip to content

Commit

Permalink
test: add a roundtrip test for lists with pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
buuhuu committed Oct 2, 2024
1 parent 5be61ba commit 25b19ac
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/roundtrip/roundtrip-fixtures/lists-with-pictures.input.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>

<head>
<title>Lists with Pictures</title>
</head>

<body>
<main>
<div>
<ul>
<li>
<picture>
<img src="./media_abc.jpg">
</picture>
</li>
<li>
<picture>
<img src="./media_abc.jpg">
</picture>
<picture>
<img src="./media_abc.jpg">
</picture>
</li>
<li>
<picture>
<img src="./media_abc.jpg">
</picture>
<picture>
<img src="./media_abc.jpg">
</picture>
<picture>
<img src="./media_abc.jpg">
</picture>
</li>
</ul>
</div>
</main>
</body>
65 changes: 65 additions & 0 deletions test/roundtrip/roundtrip-fixtures/lists-with-pictures.output.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<html>
<head>
<title>Lists with Pictures</title>
<link rel="canonical" href="https://undefined/">
<meta property="og:title" content="Lists with Pictures">
<meta property="og:url" content="https://undefined/">
<meta property="og:image" content="https://undefined/media_abc.jpg?width=1200&#x26;format=pjpg&#x26;optimize=medium">
<meta property="og:image:secure_url" content="https://undefined/media_abc.jpg?width=1200&#x26;format=pjpg&#x26;optimize=medium">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Lists with Pictures">
<meta name="twitter:image" content="https://undefined/media_abc.jpg?width=1200&#x26;format=pjpg&#x26;optimize=medium">
</head>
<body>
<header></header>
<main>
<div>
<ul>
<li>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
</li>
<li>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
</li>
<li>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
<picture>
<source type="image/webp" srcset="./media_abc.jpg?width=2000&#x26;format=webply&#x26;optimize=medium" media="(min-width: 600px)">
<source type="image/webp" srcset="./media_abc.jpg?width=750&#x26;format=webply&#x26;optimize=medium">
<source type="image/jpeg" srcset="./media_abc.jpg?width=2000&#x26;format=jpg&#x26;optimize=medium" media="(min-width: 600px)">
<img loading="lazy" alt="" src="./media_abc.jpg?width=750&#x26;format=jpg&#x26;optimize=medium">
</picture>
</li>
</ul>
</div>
</main>
<footer></footer>
</body>
</html>
1 change: 1 addition & 0 deletions test/roundtrip/roundtrip.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const specs = [
'some-text',
'all-sections',
'microdata',
'lists-with-pictures',
];

describe('Roundtrip tests', () => {
Expand Down

0 comments on commit 25b19ac

Please sign in to comment.