Skip to content

Commit

Permalink
EWPP-3310: Fix ECL footer tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergepavle committed May 22, 2023
1 parent ce96634 commit efa2345
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,6 @@ matrix:
- { PHP_VERSION: 8.0, COMPOSER_BOUNDARY: highest, TYPE: phpunit, BATCH: batch2 }
- { PHP_VERSION: 8.0, COMPOSER_BOUNDARY: highest, TYPE: phpunit, BATCH: batch3 }
- { PHP_VERSION: 8.1, COMPOSER_BOUNDARY: highest, TYPE: behat }
- { PHP_VERSION: 8.1, COMPOSER_BOUNDARYf: highest, TYPE: phpunit, BATCH: batch1 }
- { PHP_VERSION: 8.1, COMPOSER_BOUNDARY: highest, TYPE: phpunit, BATCH: batch1 }
- { PHP_VERSION: 8.1, COMPOSER_BOUNDARY: highest, TYPE: phpunit, BATCH: batch2 }
- { PHP_VERSION: 8.1, COMPOSER_BOUNDARY: highest, TYPE: phpunit, BATCH: batch3 }
1 change: 1 addition & 0 deletions templates/patterns/gallery/pattern-gallery.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
},
},
'view_all_label': "See all"|t,
'view_all_expanded_label': "Back"|t,
'counter_label': "media items"|t,
'items': _items
} %}
Expand Down
8 changes: 1 addition & 7 deletions tests/src/Functional/CorporateFooterRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -935,13 +935,7 @@ protected function assertSocialLink(NodeElement $label, NodeElement $link, array
* The component library: 'European Commission' or 'European Union'.
*/
protected function assertEclLogoPresence(NodeElement $section, string $component_library): void {
if ($component_library === 'European Union') {
$this->assertSession()->elementsCount('css', "a img.ecl-site-footer__logo-image-mobile", 1, $section);
$this->assertSession()->elementsCount('css', "a img.ecl-site-footer__logo-image-desktop", 1, $section);
}
else {
$this->assertSession()->elementsCount('css', "a img.ecl-site-footer__logo-image-desktop", 1, $section);
}
$this->assertSession()->elementsCount('css', "a img.ecl-site-footer__logo-image", 1, $section);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/src/PatternAssertions/FeaturedItemAssert.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ protected function assertBaseElements(string $html, string $variant): void {
* The DomCrawler where to check the element.
*/
protected function assertFeaturedItemImage($expected_image, string $variant, Crawler $crawler): void {
$image_div_selector = 'article.ecl-card div.ecl-card__image';
$image_div_selector = 'article.ecl-card img.ecl-card__image';
if (is_null($expected_image)) {
$this->assertElementNotExists($image_div_selector, $crawler);
return;
}
$image_div = $crawler->filter($image_div_selector);
self::assertEquals($expected_image['alt'], $image_div->attr('aria-label'));
self::assertStringContainsString($expected_image['src'], $image_div->attr('style'));
self::assertEquals($expected_image['alt'], $image_div->attr('alt'));
self::assertStringContainsString($expected_image['src'], $image_div->attr('src'));
}

/**
Expand Down

0 comments on commit efa2345

Please sign in to comment.