Skip to content

Commit

Permalink
EWPP-1472: Fix output of image (avportal) inside news content type.
Browse files Browse the repository at this point in the history
  • Loading branch information
yenyasinn committed Sep 8, 2021
1 parent 20dbf2e commit c095183
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- media.type.av_portal_photo
- responsive_image.styles.oe_theme_main_content
module:
- media_avportal
- oe_media_avportal
id: media.av_portal_photo.oe_theme_main_content
targetEntityType: media
bundle: av_portal_photo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.av_portal_video.oe_media_avportal_video
- media.type.av_portal_video
module:
- media_avportal
- oe_media_avportal
id: media.av_portal_video.oe_theme_main_content
targetEntityType: media
bundle: av_portal_video
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.document.oe_media_file
- media.type.document
module:
- file
- oe_media
id: media.document.oe_theme_main_content
targetEntityType: media
bundle: document
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- media.type.image
- responsive_image.styles.oe_theme_main_content
module:
- oe_media
- responsive_image
id: media.image.oe_theme_main_content
targetEntityType: media
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dependencies:
- field.field.media.remote_video.oe_media_oembed_video
- media.type.remote_video
module:
- media
- oe_media
id: media.remote_video.oe_theme_main_content
targetEntityType: media
bundle: remote_video
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function testFormatter(): void {

// Test the second gallery item.
$this->assertStringStartsWith(
'/media/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D1-g73ty9v04&max_width=0&max_height=0&hash=',
'/media/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D1-g73ty9v04&max_width=576&max_height=400&hash=',
$items->eq(1)->filter('.ecl-gallery__item-link')->attr('data-ecl-gallery-item-embed-src')
);
$image_node = $items->eq(1)->filter('img');
Expand Down Expand Up @@ -311,7 +311,7 @@ public function testFormatter(): void {

// Test the second gallery item.
$this->assertStringStartsWith(
'/media/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D1-g73ty9v04&max_width=0&max_height=0&hash=',
'/media/oembed?url=https%3A//www.youtube.com/watch%3Fv%3D1-g73ty9v04&max_width=576&max_height=400&hash=',
$items->eq(1)->filter('.ecl-gallery__item-link')->attr('data-ecl-gallery-item-embed-src')
);
$image_node = $items->eq(1)->filter('img');
Expand Down
2 changes: 1 addition & 1 deletion tests/Functional/ContentNewsRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function testNewsRendering(): void {

$picture = $this->assertSession()->elementExists('css', 'article[role=article] article.ecl-u-type-paragraph.ecl-u-mb-l picture');
$image = $this->assertSession()->elementExists('css', 'img.ecl-u-width-100.ecl-u-height-auto', $picture);
$this->assertContains('placeholder_news_featured_media.png', $image->getAttribute('src'));
$this->assertContains('files/styles/oe_theme_medium_no_crop/public/placeholder_news_featured_media.png', $image->getAttribute('src'));
$this->assertEquals('Alternative text news_featured_media', $image->getAttribute('alt'));

// Unpublish the media and assert it is not rendered anymore.
Expand Down
2 changes: 1 addition & 1 deletion tests/Kernel/Paragraphs/MediaParagraphsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function testTextWithMedia(): void {
'title' => NULL,
'caption' => 'Caption',
'text' => NULL,
'video' => '<iframe id="videoplayerI-163162" src="//ec.europa.eu/avservices/play.cfm?ref=I-163162&amp;lg=EN&amp;sublg=none&amp;autoplay=true&amp;tin=10&amp;tout=59" frameborder="0" allowtransparency allowfullscreen webkitallowfullscreen mozallowfullscreen width="640" height="390" class="media-avportal-content"></iframe>',
'video' => '<iframe id="videoplayerI-163162" src="//ec.europa.eu/avservices/play.cfm?ref=I-163162&amp;lg=EN&amp;sublg=none&amp;autoplay=true&amp;tin=10&amp;tout=59" frameborder="0" allowtransparency allowfullscreen webkitallowfullscreen mozallowfullscreen width="576" height="400" class="media-avportal-content"></iframe>',
'video_ratio' => '16:9',
];
$assert->assertPattern($expected_values, $html);
Expand Down

0 comments on commit c095183

Please sign in to comment.