Skip to content

Commit

Permalink
Add test cases for fetchpriority attr in `OptimizeHeroImages::generat…
Browse files Browse the repository at this point in the history
…eImg()`
  • Loading branch information
thelovekesh committed Oct 24, 2023
1 parent c40d466 commit 3852f92
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Optimizer/Transformer/OptimizeHeroImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,15 @@ public function dataTransform()
. '</amp-story-player>'
),
],

'preserves fetchpriority attribute from noscript fallback img on prerendered image' => [
$input(
'<amp-img width="500" height="400" src="/img1.png"><noscript><img src="/img1.png" width="500" height="400" fetchpriority="high"></noscript></amp-img>'
),
$output(
'<amp-img data-hero width="500" height="400" src="/img1.png" i-amphtml-ssr><img class="i-amphtml-fill-content i-amphtml-replaced-content" decoding="async" fetchpriority="high" src="/img1.png"></amp-img>'
),
],
];
}

Expand Down

0 comments on commit 3852f92

Please sign in to comment.