Skip to content

Commit

Permalink
EWPP-3764: Update default carousel paragraph variant.
Browse files Browse the repository at this point in the history
  • Loading branch information
22Alexandra committed Nov 29, 2023
1 parent 529ca7e commit 7d8febb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion oe_theme.theme
Original file line number Diff line number Diff line change
Expand Up @@ -2226,7 +2226,7 @@ function oe_theme_preprocess_paragraph__oe_carousel(array &$variables): void {
'centered' => FALSE,
// The paragraph has a required image field, so we need to set a default
// image variant in order to render the image.
'variant' => 'text-highlight',
'variant' => 'text-overlay',
];
$cacheability->applyTo($variables);
}
Expand Down
9 changes: 4 additions & 5 deletions tests/src/Kernel/Paragraphs/MediaParagraphsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,6 @@ public function testIframe(): void {
* Test Carousel paragraph rendering.
*/
public function testCarousel(): void {
$this->markTestSkipped('Must be re-enabled before considering migration to ECL 4 as complete.');
// Set image media translatable.
$this->container->get('content_translation.manager')
->setEnabled('media', 'image', TRUE);
Expand Down Expand Up @@ -1084,29 +1083,29 @@ public function testCarousel(): void {
'title' => 'Item 1',
'image' => $this->container->get('file_url_generator')->generateAbsoluteString($en_file_1_uri),
'image_alt' => 'First image alt en',
'variant' => 'text-highlight',
'variant' => 'text-overlay',
],
[
'title' => 'Item 2',
'description' => 'Item description 2',
'url' => 'http://www.example.com/',
'url_text' => 'CTA 2',
'image' => $this->container->get('file_url_generator')->generateAbsoluteString($en_file_2_uri),
'variant' => 'text-highlight',
'variant' => 'text-overlay',
],
[
'title' => 'Item 3',
'image' => $this->container->get('file_url_generator')->generateAbsoluteString($en_file_1_uri),
'image_alt' => 'First image alt en',
'variant' => 'text-highlight',
'variant' => 'text-overlay',
],
[
'title' => 'Item 4',
'description' => 'Item description 4',
'url' => '/',
'url_text' => 'CTA 4',
'image' => $this->container->get('file_url_generator')->generateAbsoluteString($en_file_2_uri),
'variant' => 'text-highlight',
'variant' => 'text-overlay',
],
],
];
Expand Down
4 changes: 2 additions & 2 deletions tests/src/PatternAssertions/CarouselAssert.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function assertItems(array $expected_items, Crawler $crawler): void {
$item = $items->eq($index);
// Assert carousel item (banner) variant.
if (!isset($expected_item['variant'])) {
$this->assertElementExists('section.ecl-banner.ecl-banner--primary.ecl-banner--l', $item);
$this->assertElementExists('section.ecl-banner.ecl-banner--plain-background.ecl-banner--l', $item);
}
else {
$this->assertElementExists('section.ecl-banner.ecl-banner--' . $expected_item['variant'], $item);
Expand All @@ -71,7 +71,7 @@ protected function assertItems(array $expected_items, Crawler $crawler): void {
$this->assertElementNotExists('div.ecl-banner__cta a', $item);
}
else {
$this->assertElementAttribute($expected_item['url'], 'div.ecl-banner__cta a.ecl-link--icon-after.ecl-banner__link-cta', 'href', $item);
$this->assertElementAttribute($expected_item['url'], 'div.ecl-banner__cta a.ecl-link--icon.ecl-banner__link-cta', 'href', $item);
$this->assertElementText($expected_item['url_text'], 'div.ecl-banner__cta a span.ecl-link__label', $item);
}
// Assert image.
Expand Down

0 comments on commit 7d8febb

Please sign in to comment.