Skip to content

Commit

Permalink
Add test cases for fetchpriority attr in AMP_Img_Sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Oct 25, 2023
1 parent 67ebeea commit 1df48d7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/php/test-amp-img-sanitizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,27 @@ public function get_data() {
'native_img_used' => false,
],
],

'fetchpriority_attr_not_added_to_amp-img' => [
'<img width="825" height="510" src="https://placehold.it/825x510" fetchpriority="high">',
'<amp-img width="825" height="510" src="https://placehold.it/825x510" class="amp-wp-enforced-sizes" layout="intrinsic"></amp-img>',
[
'add_noscript_fallback' => false,
],
],

'fetchpriority_attr_is_preserved_in_noscript_fallback_img' => [
'<img width="825" height="510" src="https://placehold.it/825x510" fetchpriority="high">',
'<amp-img width="825" height="510" src="https://placehold.it/825x510" class="amp-wp-enforced-sizes" layout="intrinsic"><noscript><img width="825" height="510" src="https://placehold.it/825x510" fetchpriority="high"></noscript></amp-img>',
],

'fetchpriority_attr_is_preserved_in_native_img' => [
'<img width="825" height="510" src="https://placehold.it/825x510" fetchpriority="high">',
'<img width="825" height="510" src="https://placehold.it/825x510" fetchpriority="high" decoding="async" class="amp-wp-enforced-sizes">',
[
'native_img_used' => true,
],
],
];
}

Expand Down

0 comments on commit 1df48d7

Please sign in to comment.