Skip to content

Commit

Permalink
OEL-1618: Removing fw-bold classes and add heading to DescriptionList…
Browse files Browse the repository at this point in the history
… and ContentRow paragraphs.
  • Loading branch information
escuriola committed Jun 3, 2022
1 parent 3844821 commit 5fd2744
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,17 @@ public function testWithInpageNavigationRendering(): void {
// Assert the paragraphs where added into the right side column.
$content = $crawler->filter('div.col-md-9');
$this->assertCount(1, $content);
$rich_text_title = $content->filter('h4.fw-bold.mb-4');
$rich_text_title = $content->filter('h2.bcl-heading')->eq(0);
$this->assertSame('Title rich text test 1', trim($rich_text_title->text()));
$links_block_title = $content->filter('h2.bcl-heading');
$links_block_title = $content->filter('h2.bcl-heading')->eq(1);
$this->assertSame('Links block test', $links_block_title->text());
$facts_figures = $content->filter('div.bcl-fact-figures--default');
$this->assertStringContainsString('Facts and Figures test', $facts_figures->filter('h2.bcl-heading')->text());
$blockquote_blockquote = $content->filter('blockquote.blockquote');
$this->assertStringContainsString('Maecenas id urna eleifend', $blockquote_blockquote->text());
$blockquote_footer = $content->filter('figcaption.blockquote-footer');
$this->assertSame('Quote 1', trim($blockquote_footer->text()));
$social_media_title = $content->filter('h2.bcl-heading')->eq(2);
$social_media_title = $content->filter('h2.bcl-heading')->eq(3);
$this->assertStringContainsString('Social media block', $social_media_title->text());
$accordion_items = $content->filter('.accordion-item');
$this->assertStringContainsString('Accordion item 1', $accordion_items->eq(0)->text());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ public function testRendering(): void {
$html = $this->renderParagraph($paragraph);
$crawler = new Crawler($html);

$this->assertCount(1, $crawler->filter('h4'));
$this->assertCount(1, $crawler->filter('h2.bcl-heading'));
$this->assertCount(1, $crawler->filter('dl.d-md-grid.grid-3-9'));
$this->assertCount(2, $crawler->filter('dd'));
$this->assertCount(2, $crawler->filter('dt'));

$title = $crawler->filter('h4.fw-bold.mb-4');
$title = $crawler->filter('h2.bcl-heading');
$this->assertEquals('Description list paragraph', $title->text());

$term_1 = $crawler->filter('dl > div:nth-child(1) > dt');
Expand All @@ -100,7 +100,7 @@ public function testRendering(): void {
$html = $this->renderParagraph($paragraph);
$crawler = new Crawler($html);

$title = $crawler->filter('h4.fw-bold.mb-4');
$title = $crawler->filter('h2.bcl-heading');
$this->assertEquals('Description list paragraph', $title->text());

$term_1 = $crawler->filter('dl > dt:nth-child(1)');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
#}

{% if title is not empty %}
<h4 class="fw-bold mb-4">{{ title }}</h4>
{% include '@oe-bcl/bcl-heading/heading.html.twig' with {
title: title,
} only %}
{% endif %}

{{ pattern('description_list', {
Expand Down
4 changes: 3 additions & 1 deletion templates/paragraphs/paragraph--oe-rich-text.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
* @see ./modules/contrib/paragraphs/templates/paragraph.html.twig
*/
#}
<h4 class="fw-bold mb-4">{{ content.field_oe_title }}</h4>
{% include '@oe-bcl/bcl-heading/heading.html.twig' with {
title: content.field_oe_title,
} only %}
{{ content|without('field_oe_title') }}

0 comments on commit 5fd2744

Please sign in to comment.