Skip to content

Commit 9169bca

Browse files
committed
Update YT test case to check different media queries
1 parent 096497f commit 9169bca

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugins/embed-optimizer/tests/test-cases/single-youtube-embed-outside-viewport-on-mobile.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
),
1111
);
1212

13-
// Embed not visible on mobile.
14-
if ( 480 === $viewport_width ) {
13+
// Embed is ONLY visible on phablet and tablet.
14+
if ( ! in_array( $viewport_width, array( 600, 782 ), true ) ) {
1515
$elements[0]['intersectionRatio'] = 0;
1616
$elements[0]['isLCP'] = false;
1717
}
@@ -56,8 +56,8 @@
5656
@media (min-width: 601px) and (max-width: 782px) { #embed-optimizer-a7659db28ecaa36ddee6ae66857dabd8 { min-height: 500px; } }
5757
@media (min-width: 783px) { #embed-optimizer-a7659db28ecaa36ddee6ae66857dabd8 { min-height: 500px; } }
5858
</style>
59-
<link data-od-added-tag rel="preconnect" href="https://i.ytimg.com" media="(min-width: 481px)">
60-
<link data-od-added-tag rel="preconnect" href="https://www.youtube.com" media="(min-width: 481px)">
59+
<link data-od-added-tag rel="preconnect" href="https://i.ytimg.com" media="(min-width: 481px) and (max-width: 782px)">
60+
<link data-od-added-tag rel="preconnect" href="https://www.youtube.com" media="(min-width: 481px) and (max-width: 782px)">
6161
</head>
6262
<body>
6363
<figure data-od-added-id id="embed-optimizer-a7659db28ecaa36ddee6ae66857dabd8" class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">

0 commit comments

Comments
 (0)