Skip to content

Commit

Permalink
Merge pull request #166 from openeuropa/OEL-1823
Browse files Browse the repository at this point in the history
OEL-1823: Upgrade to BCL 0.24.1
  • Loading branch information
brummbar authored Aug 5, 2022
2 parents 7c8b67e + e1c22f1 commit c186bfe
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 32 deletions.
5 changes: 1 addition & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"drupal/daterange_compact": "^2.0",
"drupal/twig_field_value": "^2.0",
"openeuropa/composer-artifacts": "^1.0.0-alpha1",
"openeuropa/oe_bootstrap_theme": "^1.0.0-beta4"
"openeuropa/oe_bootstrap_theme": "0.1.202208041835"
},
"require-dev": {
"composer/installers": "^1.11",
Expand Down Expand Up @@ -95,9 +95,6 @@
"patches": {
"drupal/entity_reference_revisions": {
"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": {
"temporary ticket patch": "https://patch-diff.githubusercontent.com/raw/openeuropa/oe_bootstrap_theme/pull/250.diff"
}
},
"drupal-scaffold": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testListPageRendering(): void {

// Assert offcanvas.
$offcanvas = $left_column->find('css', 'div.bcl-offcanvas');
$title = $offcanvas->find('css', 'h3.offcanvas-title');
$title = $offcanvas->find('css', '.offcanvas-title');
$this->assertSame('Filter options', $title->getText());
$offcanvas->hasField('Title');
$offcanvas->hasButton('Search');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,11 @@ public function testWithInpageNavigationRendering(): void {
$this->assertCount(1, $crawler->filter('div.row > div > nav.bcl-inpage-navigation'));
$this->assertCount(8, $crawler->filter('p'));
// Assert the left column navigation.
$left = $crawler->filter('div.col-md-3.d-none.d-md-block');
$left = $crawler->filter('div.bcl-sidebar');
$nav = $left->filter('nav.bcl-inpage-navigation');
$this->assertCount(1, $nav);
$h3 = $nav->filter('h3');
$this->assertSame('Page content', $h3->text());
$h2 = $nav->filter('h2');
$this->assertSame('Page content', $h2->text());
$ul = $left->filter('ul.nav.nav-pills.flex-column');
$this->assertCount(1, $ul);
$links = $ul->filter('li.nav-item a.nav-link');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function testRendering(): void {
$this->assertCount(1, $crawler->filter('h2.bcl-heading'));
$this->assertCount(1, $crawler->filter('div.row-cols-md-3.row'));
$this->assertCount(6, $crawler->filter('svg.bi.icon--l'));
$this->assertCount(6, $crawler->filter('div.fs-3'));
$this->assertCount(6, $crawler->filter('div.fs-4'));
$this->assertCount(6, $crawler->filter('div.fs-5'));
$this->assertCount(6, $crawler->filter('div.col'));

Expand All @@ -93,7 +93,7 @@ public function testRendering(): void {
$link->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(1) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(1) > div.fs-4');
$this->assertStringContainsString(
'1529 JIRA Ticket',
$title_fact->html()
Expand All @@ -109,7 +109,7 @@ public function testRendering(): void {
$description_fact->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(2) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(2) > div.fs-4');
$this->assertStringContainsString(
'337 Features',
$title_fact->html()
Expand All @@ -125,7 +125,7 @@ public function testRendering(): void {
$description_fact->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(3) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(3) > div.fs-4');
$this->assertStringContainsString(
'107 Tests',
$title_fact->html()
Expand All @@ -141,7 +141,7 @@ public function testRendering(): void {
$description_fact->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(4) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(4) > div.fs-4');
$this->assertStringContainsString(
'5670 Variants',
$title_fact->html()
Expand All @@ -157,7 +157,7 @@ public function testRendering(): void {
$description_fact->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(5) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(5) > div.fs-4');
$this->assertStringContainsString(
'345 Dev Ticket',
$title_fact->html()
Expand All @@ -173,7 +173,7 @@ public function testRendering(): void {
$description_fact->html()
);

$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(6) > div.fs-3');
$title_fact = $crawler->filter('div.row-cols-md-3.row > div.col:nth-child(6) > div.fs-4');
$this->assertStringContainsString(
'43 Components',
$title_fact->html()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,25 @@ public function testTimeline(): void {
$this->assertCount(7, $crawler->filter('ol.bcl-timeline li'));
$this->assertCount(1, $crawler->filter('ol.bcl-timeline li .label-collapsed'));
$this->assertCount(1, $crawler->filter('ol.bcl-timeline li.bcl-timeline__item--toggle'));
$this->assertEquals('Label 1', trim($crawler->filter('ol.bcl-timeline li:nth-child(1) h5')->html()));
$this->assertEquals('Title 1', trim($crawler->filter('ol.bcl-timeline li:nth-child(1) h6')->html()));
$this->assertEquals('Label 1', trim($crawler->filter('ol.bcl-timeline li:nth-child(1) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 1', trim($crawler->filter('ol.bcl-timeline li:nth-child(1) p.fs-6.fw-medium')->html()));
$this->assertEquals('Description 1', trim($crawler->filter('ol.bcl-timeline li:nth-child(1) div')->html()));
$this->assertEquals('Label 2', trim($crawler->filter('ol.bcl-timeline li:nth-child(2) h5')->html()));
$this->assertEquals('Title 2', trim($crawler->filter('ol.bcl-timeline li:nth-child(2) h6')->html()));
$this->assertEquals('Label 2', trim($crawler->filter('ol.bcl-timeline li:nth-child(2) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 2', trim($crawler->filter('ol.bcl-timeline li:nth-child(2) p.fs-6.fw-medium')->html()));
// Explicit format "plain_text" specified.
$this->assertEquals('<p>Description 2</p>', trim($crawler->filter('ol.bcl-timeline li:nth-child(2) div')->html()));
$this->assertEquals('Label 3', trim($crawler->filter('ol.bcl-timeline li:nth-child(3) h5')->html()));
$this->assertEquals('Title 3', trim($crawler->filter('ol.bcl-timeline li:nth-child(3) h6')->html()));
$this->assertEquals('Label 3', trim($crawler->filter('ol.bcl-timeline li:nth-child(3) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 3', trim($crawler->filter('ol.bcl-timeline li:nth-child(3) p.fs-6.fw-medium')->html()));
$this->assertEquals('<p>Description <strong>3</strong></p>', trim($crawler->filter('ol.bcl-timeline li:nth-child(3) div')->html()));
$this->assertEquals('Label 4', trim($crawler->filter('ol.bcl-timeline li:nth-child(4) h5')->html()));
$this->assertEquals('Title 4', trim($crawler->filter('ol.bcl-timeline li:nth-child(4) h6')->html()));
$this->assertEquals('Label 4', trim($crawler->filter('ol.bcl-timeline li:nth-child(4) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 4', trim($crawler->filter('ol.bcl-timeline li:nth-child(4) p.fs-6.fw-medium')->html()));
// Explicit format "filtered_html" specified.
$this->assertEquals('Description <strong>4</strong>', trim($crawler->filter('ol.bcl-timeline li:nth-child(4) div')->html()));
$this->assertEquals('<p>Description <strong>5</strong></p>', trim($crawler->filter('ol.bcl-timeline li:nth-child(5) div')->html()));
$this->assertEquals('Label 5', trim($crawler->filter('ol.bcl-timeline li:nth-child(5) h5')->html()));
$this->assertEquals('Title 5', trim($crawler->filter('ol.bcl-timeline li:nth-child(5) h6')->html()));
$this->assertEquals('Label 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) h5')->html()));
$this->assertEquals('Title 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) h6')->html()));
$this->assertEquals('Label 5', trim($crawler->filter('ol.bcl-timeline li:nth-child(5) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 5', trim($crawler->filter('ol.bcl-timeline li:nth-child(5) p.fs-6.fw-medium')->html()));
$this->assertEquals('Label 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) p.fs-5.fw-medium')->html()));
$this->assertEquals('Title 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) p.fs-6.fw-medium')->html()));
// Explicit format "full_html" specified.
$this->assertEquals('Description 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) div')->html()));
$this->assertEquals('Show more 3 items', trim($crawler->filter('button .label-collapsed')->text()));
Expand Down
2 changes: 1 addition & 1 deletion templates/list_pages/node--oe-list-page--full.html.twig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% apply spaceless %}
{{ content|without('extra_field_oe_list_page_filters:node:oe_list_page', 'extra_field_oe_list_page_results:node:oe_list_page', 'extra_field_oe_list_page_selected_filters:node:oe_list_page', 'extra_field_oe_list_page_total_count:node:oe_list_page') }}
<div class="row">
<div class="col-12 col-lg-3">
<div class="col-12 bcl-sidebar col-lg-3">
{% set filters = content['extra_field_oe_list_page_filters:node:oe_list_page']|render %}
{% if filters %}
{{ pattern('offcanvas', {
Expand Down
2 changes: 1 addition & 1 deletion templates/overrides/page/page.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
{% endif %}

{% if page.sidebar_left %}
<div class="col-12 col-lg-3">
<div class="col-12 bcl-sidebar col-lg-3">
{{ page.sidebar_left }}
</div>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Functional/ContentEventRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function testEventPage(): void {
// Assert in-page navigation title.
$this->assertEquals(
'Page content',
trim($crawler->filter('nav.bcl-inpage-navigation > h3')->text())
trim($crawler->filter('nav.bcl-inpage-navigation > h2')->text())
);

// Assert in-page navigation links.
Expand Down
2 changes: 1 addition & 1 deletion tests/src/Kernel/FacetsFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function testBlockRendering(): void {
$offcanvas = $crawler->filter('div#bcl-offcanvas');
$header = $offcanvas->filter('div.offcanvas-header');
$this->assertCount(1, $header);
$title = $header->filter('h3.offcanvas-title');
$title = $header->filter('.offcanvas-title');
$this->assertSame('Facets form', $title->text());
$button = $header->filter('button');
$this->assertSame('offcanvas', $button->attr('data-bs-dismiss'));
Expand Down
2 changes: 1 addition & 1 deletion tests/src/PatternAssertions/InPageNavigationAssert.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected function getAssertions(string $variant): array {
return [
'title' => [
[$this, 'assertElementText'],
'h3',
'h2',
],
'links' => [
[$this, 'assertList'],
Expand Down

0 comments on commit c186bfe

Please sign in to comment.