Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Unverified Commit 8836acd4 authored by escuriola's avatar escuriola Committed by Francesco SARDARA
Browse files

OEL-1823: Fixing tests after BCL upgrade.

parent d70de4be
No related branches found
No related tags found
1 merge request!166OEL-1823: Upgrade to BCL 0.24.1
...@@ -54,7 +54,7 @@ class ListPagesTest extends WhitelabelBrowserTestBase { ...@@ -54,7 +54,7 @@ class ListPagesTest extends WhitelabelBrowserTestBase {
// Assert offcanvas. // Assert offcanvas.
$offcanvas = $left_column->find('css', 'div.bcl-offcanvas'); $offcanvas = $left_column->find('css', 'div.bcl-offcanvas');
$title = $offcanvas->find('css', 'h3.offcanvas-title'); $title = $offcanvas->find('css', 'h2.offcanvas-title');
$this->assertSame('Filter options', $title->getText()); $this->assertSame('Filter options', $title->getText());
$offcanvas->hasField('Title'); $offcanvas->hasField('Title');
$offcanvas->hasButton('Search'); $offcanvas->hasButton('Search');
......
...@@ -144,11 +144,11 @@ class ContentRowTest extends ParagraphsTestBase { ...@@ -144,11 +144,11 @@ class ContentRowTest extends ParagraphsTestBase {
$this->assertCount(1, $crawler->filter('div.row > div > nav.bcl-inpage-navigation')); $this->assertCount(1, $crawler->filter('div.row > div > nav.bcl-inpage-navigation'));
$this->assertCount(8, $crawler->filter('p')); $this->assertCount(8, $crawler->filter('p'));
// Assert the left column navigation. // 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'); $nav = $left->filter('nav.bcl-inpage-navigation');
$this->assertCount(1, $nav); $this->assertCount(1, $nav);
$h3 = $nav->filter('h3'); $h2 = $nav->filter('h2');
$this->assertSame('Page content', $h3->text()); $this->assertSame('Page content', $h2->text());
$ul = $left->filter('ul.nav.nav-pills.flex-column'); $ul = $left->filter('ul.nav.nav-pills.flex-column');
$this->assertCount(1, $ul); $this->assertCount(1, $ul);
$links = $ul->filter('li.nav-item a.nav-link'); $links = $ul->filter('li.nav-item a.nav-link');
......
...@@ -83,7 +83,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -83,7 +83,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$this->assertCount(1, $crawler->filter('h2.bcl-heading')); $this->assertCount(1, $crawler->filter('h2.bcl-heading'));
$this->assertCount(1, $crawler->filter('div.row-cols-md-3.row')); $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('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.fs-5'));
$this->assertCount(6, $crawler->filter('div.col')); $this->assertCount(6, $crawler->filter('div.col'));
...@@ -93,7 +93,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -93,7 +93,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$link->html() $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( $this->assertStringContainsString(
'1529 JIRA Ticket', '1529 JIRA Ticket',
$title_fact->html() $title_fact->html()
...@@ -109,7 +109,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -109,7 +109,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$description_fact->html() $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( $this->assertStringContainsString(
'337 Features', '337 Features',
$title_fact->html() $title_fact->html()
...@@ -125,7 +125,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -125,7 +125,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$description_fact->html() $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( $this->assertStringContainsString(
'107 Tests', '107 Tests',
$title_fact->html() $title_fact->html()
...@@ -141,7 +141,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -141,7 +141,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$description_fact->html() $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( $this->assertStringContainsString(
'5670 Variants', '5670 Variants',
$title_fact->html() $title_fact->html()
...@@ -157,7 +157,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -157,7 +157,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$description_fact->html() $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( $this->assertStringContainsString(
'345 Dev Ticket', '345 Dev Ticket',
$title_fact->html() $title_fact->html()
...@@ -173,7 +173,7 @@ class FactsFiguresTest extends ParagraphsTestBase { ...@@ -173,7 +173,7 @@ class FactsFiguresTest extends ParagraphsTestBase {
$description_fact->html() $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( $this->assertStringContainsString(
'43 Components', '43 Components',
$title_fact->html() $title_fact->html()
......
...@@ -119,25 +119,25 @@ class TimelineParagraphTest extends ParagraphsTestBase { ...@@ -119,25 +119,25 @@ class TimelineParagraphTest extends ParagraphsTestBase {
$this->assertCount(7, $crawler->filter('ol.bcl-timeline li')); $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 .label-collapsed'));
$this->assertCount(1, $crawler->filter('ol.bcl-timeline li.bcl-timeline__item--toggle')); $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('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) h6')->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('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('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) h6')->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. // 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('<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('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) h6')->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('<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('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) h6')->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. // 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('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('<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('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) h6')->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) h5')->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) h6')->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. // Explicit format "full_html" specified.
$this->assertEquals('Description 6', trim($crawler->filter('ol.bcl-timeline li:nth-child(6) div')->html())); $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())); $this->assertEquals('Show more 3 items', trim($crawler->filter('button .label-collapsed')->text()));
......
...@@ -123,7 +123,7 @@ class ContentEventRenderTest extends WhitelabelBrowserTestBase { ...@@ -123,7 +123,7 @@ class ContentEventRenderTest extends WhitelabelBrowserTestBase {
// Assert in-page navigation title. // Assert in-page navigation title.
$this->assertEquals( $this->assertEquals(
'Page content', '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. // Assert in-page navigation links.
......
...@@ -96,7 +96,7 @@ class FacetsFormTest extends KernelTestBase { ...@@ -96,7 +96,7 @@ class FacetsFormTest extends KernelTestBase {
$offcanvas = $crawler->filter('div#bcl-offcanvas'); $offcanvas = $crawler->filter('div#bcl-offcanvas');
$header = $offcanvas->filter('div.offcanvas-header'); $header = $offcanvas->filter('div.offcanvas-header');
$this->assertCount(1, $header); $this->assertCount(1, $header);
$title = $header->filter('h3.offcanvas-title'); $title = $header->filter('h2.offcanvas-title');
$this->assertSame('Facets form', $title->text()); $this->assertSame('Facets form', $title->text());
$button = $header->filter('button'); $button = $header->filter('button');
$this->assertSame('offcanvas', $button->attr('data-bs-dismiss')); $this->assertSame('offcanvas', $button->attr('data-bs-dismiss'));
......
...@@ -18,7 +18,7 @@ class InPageNavigationAssert extends BasePatternAssert { ...@@ -18,7 +18,7 @@ class InPageNavigationAssert extends BasePatternAssert {
return [ return [
'title' => [ 'title' => [
[$this, 'assertElementText'], [$this, 'assertElementText'],
'h3', 'h2',
], ],
'links' => [ 'links' => [
[$this, 'assertList'], [$this, 'assertList'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment