From 0361e0dd6447c65af7067edc37b51a59179a3ad5 Mon Sep 17 00:00:00 2001
From: escuriola <escuriola@gmail.com>
Date: Mon, 4 Jul 2022 11:47:52 +0200
Subject: [PATCH 1/4] OEL-1326: Remove from testing date and other non-useful
 data. Remove also some asserts with estetical classes.

---
 .../Kernel/Paragraphs/ListingParagraphsTest.php | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php
index f0e29187..5ef21e0b 100644
--- a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php
+++ b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/Paragraphs/ListingParagraphsTest.php
@@ -36,7 +36,6 @@ class ListingParagraphsTest extends ParagraphsTestBase {
    * Test List Items Block paragraph rendering.
    */
   public function testListing(): void {
-
     // Create a sample media entity to be embedded.
     $image_file = File::create([
       'uri' => $this->getTestFiles('image')[0]->uri,
@@ -50,7 +49,6 @@ class ListingParagraphsTest extends ParagraphsTestBase {
     ]);
 
     $node = $this->createNode([
-      'created' => 1636977600,
       'type' => 'article',
     ]);
     $nid = (int) $node->id();
@@ -75,8 +73,7 @@ class ListingParagraphsTest extends ParagraphsTestBase {
     $assert->assertDefaultListingRendering($crawler, $image_file);
     $this->assertCount(1, $crawler->filter('div.bcl-listing--default-1-col'));
     $this->assertCount(1, $crawler->filter('div.row.row-cols-1'));
-    $this->assertCount(6, $crawler->filter('div.col-md-3.col-lg-2.rounded'));
-    $this->assertCount(6, $crawler->filter('div.col-md-9.col-lg-10'));
+    $this->assertCount(6, $crawler->filter('div.card-body'));
 
     // Testing Default 2 col.
     $paragraph->get('field_oe_list_item_block_layout')->setValue('two_columns');
@@ -88,9 +85,8 @@ class ListingParagraphsTest extends ParagraphsTestBase {
     $assert->assertListingRendering($crawler, $nid);
     $assert->assertDefaultListingRendering($crawler, $image_file);
     $this->assertCount(1, $crawler->filter('div.bcl-listing--default-2-col'));
-    $this->assertCount(1, $crawler->filter('div.row.row-cols-1.row-cols-md-2'));
-    $this->assertCount(6, $crawler->filter('div.col-xl-3.col-md-5'));
-    $this->assertCount(6, $crawler->filter('div.col-xl-9.col-md-7'));
+    $this->assertCount(1, $crawler->filter('div.row.row-cols-1'));
+    $this->assertCount(6, $crawler->filter('div.card-body'));
 
     // Testing Default 3 col.
     $paragraph->get('field_oe_list_item_block_layout')->setValue('three_columns');
@@ -102,9 +98,8 @@ class ListingParagraphsTest extends ParagraphsTestBase {
     $assert->assertListingRendering($crawler, $nid);
     $assert->assertDefaultListingRendering($crawler, $image_file);
     $this->assertCount(1, $crawler->filter('div.bcl-listing--default-3-col'));
-    $this->assertCount(1, $crawler->filter('div.row.row-cols-1.row-cols-md-2.row-cols-xl-3'));
-    $this->assertCount(6, $crawler->filter('div.col-lg-4.col-md-6'));
-    $this->assertCount(6, $crawler->filter('div.col-lg-8.col-md-6'));
+    $this->assertCount(1, $crawler->filter('div.row.row-cols-1'));
+    $this->assertCount(6, $crawler->filter('div.card-body'));
 
     // Testing Highlight 1 col.
     $paragraph->get('oe_paragraphs_variant')->setValue('highlight');
@@ -118,7 +113,6 @@ class ListingParagraphsTest extends ParagraphsTestBase {
     $assert->assertHighlightListingRendering($crawler, $image_file);
     $this->assertCount(1, $crawler->filter('div.bcl-listing--highlight-1-col'));
     $this->assertCount(1, $crawler->filter('div.row.row-cols-1'));
-    $this->assertCount(6, $crawler->filter('div.col.mt-4-5'));
     $this->assertCount(6, $crawler->filter('div.card-body'));
 
     // Testing Highlight 2 col.
@@ -174,7 +168,6 @@ class ListingParagraphsTest extends ParagraphsTestBase {
           'alt' => 'Alt for image ' . $i,
           'target_id' => $image_file->id(),
         ],
-        'field_oe_date' => '2011-11-13',
         'field_oe_meta' => [
           0 => [
             'value' => 'Label 1 - ' . $i,
-- 
GitLab


From 51a4b923e7225736851e0752c3146936a1669866 Mon Sep 17 00:00:00 2001
From: escuriola <escuriola@gmail.com>
Date: Mon, 4 Jul 2022 11:49:39 +0200
Subject: [PATCH 2/4] OEL-1326: Not using a variable for code used only once.

---
 .../oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module   | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module b/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module
index 143bea03..e7e824d0 100644
--- a/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module
+++ b/modules/oe_whitelabel_paragraphs/oe_whitelabel_paragraphs.module
@@ -226,11 +226,10 @@ function oe_whitelabel_preprocess_paragraph__oe_list_item_block(array &$variable
       $card_badges[] = $meta_item->value;
     }
 
-    $card_title = $card_paragraph->get('field_oe_title')->value;
     /** @var \Drupal\link\LinkItemInterface|null $card_link_item */
     $card_link_item = $card_paragraph->get('field_oe_link')->first();
     $variables['items'][] = [
-      'title' => $card_title,
+      'title' => $card_paragraph->get('field_oe_title')->value,
       'url' => $card_link_item ? $card_link_item->getUrl() : '',
       'text' => $card_paragraph->get('field_oe_text_long')->value,
       'image' => $card_image,
-- 
GitLab


From 63368d9036d71e941e3ad0406fe5c84da26e90c9 Mon Sep 17 00:00:00 2001
From: Francesco Sardara <francesco@tdgwebservices.com>
Date: Thu, 4 Aug 2022 21:45:15 +0200
Subject: [PATCH 3/4] OEL-1326: Temporary ticket patch to allow merging.

Multiple tickets were merged in oe_bootstrap_theme but not the corresponding
in whitelabel.
---
 composer.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/composer.json b/composer.json
index 7b839c0d..cd89274e 100644
--- a/composer.json
+++ b/composer.json
@@ -97,7 +97,7 @@
                 "https://www.drupal.org/project/entity_reference_revisions/issues/2937835": "https://www.drupal.org/files/issues/2021-03-26/entity_reference_revisions-field_formatter_label-2937835-36.patch"
             },
             "openeuropa/oe_bootstrap_theme": {
-                "latest": "https://github.com/openeuropa/oe_bootstrap_theme/compare/1.0.0-beta4...1.x.diff"
+                "temporary ticket patch": "https://patch-diff.githubusercontent.com/raw/openeuropa/oe_bootstrap_theme/pull/250.diff"
             }
         },
         "drupal-scaffold": {
-- 
GitLab


From 0cb544bb30693a317512b8f2ab4a048122c3c77d Mon Sep 17 00:00:00 2001
From: Francesco Sardara <francesco@tdgwebservices.com>
Date: Fri, 5 Aug 2022 08:30:34 +0200
Subject: [PATCH 4/4] OEL-1326: Use correct class for card links.

---
 .../tests/src/Kernel/PatternAssertions/ListingAssertion.php   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php
index 5217906d..a1e9728b 100644
--- a/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php
+++ b/modules/oe_whitelabel_paragraphs/tests/src/Kernel/PatternAssertions/ListingAssertion.php
@@ -59,14 +59,14 @@ class ListingAssertion extends Assert {
     $this->assertCount(6, $crawler->filter('div.row-cols-1.g-4 > div.col'));
     $this->assertStringContainsString('Listing item block title', trim($crawler->filter('h2.bcl-heading')->text()));
     $this->assertCount(6, $crawler->filter('h1.card-title'));
-    $link_element = $crawler->filter('a.text-underline-hover');
+    $link_element = $crawler->filter('a.standalone');
     $this->assertCount(6, $link_element);
     $this->assertStringContainsString(
       'node/' . $nid,
       $link_element->attr('href')
     );
     $text_element = $crawler->filter('div.card-text');
-    $this->assertStringContainsString('Item title 1', trim($crawler->filter('h1.card-title > a.text-underline-hover')->text()));
+    $this->assertStringContainsString('Item title 1', trim($crawler->filter('h1.card-title > a.standalone')->text()));
     $this->assertStringContainsString('Label 1 - 1', trim($crawler->filter('span.badge')->eq(0)->text()));
     $this->assertStringContainsString('Label 2 - 1', trim($crawler->filter('span.badge')->eq(1)->text()));
     $this->assertStringContainsString(
-- 
GitLab