Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EWPP-3876: Re-enable and adapt Organisation tests. #1391

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#}
{% for item in items %}
{% if item.content|render|striptags|trim is not empty %}
<div{{ not loop.last ? ' class="ecl-u-border-bottom ecl-u-border-color-grey-15 ecl-u-mb-m ecl-u-pb-m"'}}>{{ item.content }}</div>
<div{% if not loop.last %}
class="ecl-u-border-bottom {{ ecl_class_border_color() }} ecl-u-mb-m ecl-u-pb-m"{% endif %}>
{{ item.content }}
</div>
{% endif %}
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
*/
#}

<article class="ecl-u-mb-l ecl-u-border-bottom ecl-u-border-width-3 ecl-u-border-color-grey-15 ecl-content-item ecl-u-d-flex ecl-u-pb-m">
<article class="ecl-u-mb-l ecl-u-border-bottom ecl-u-border-width-3 {{ ecl_class_border_color() }} ecl-content-item ecl-u-d-flex ecl-u-pb-m">
{% if logo is not empty %}
<div role="img"
aria-label="{{ logo.alt }}"
class="ecl-u-flex-shrink-0 ecl-u-mr-l ecl-u-media-a-s ecl-u-media-bg-size-contain ecl-u-media-bg-repeat-none ecl-u-d-l-block ecl-u-media-bg-position-center"
style="background-image: url('{{ logo.src }}');"></div>
{% endif %}

<div class="ecl-u-flex-grow-1 ecl-u-type-color-grey">
<div class="ecl-u-flex-grow-1 ecl-u-type-color-dark">
<h4 class="ecl-u-type-heading-4 ecl-u-mb-s ecl-u-mt-none">
{{ name }}{% if acronym is not empty %} ({{ acronym }}){% endif %}
</h4>
Expand Down
11 changes: 5 additions & 6 deletions tests/src/Functional/ContentOrganisationRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ protected function setUp(): void {
* Tests that the Organisation page renders correctly.
*/
public function testOrganisationRendering(): void {
$this->markTestSkipped('Must be re-enabled before considering migration to ECL 4 as complete.');
$file = \Drupal::service('file.repository')->writeData(file_get_contents(\Drupal::service('extension.list.theme')->getPath('oe_theme') . '/tests/fixtures/example_1.jpeg'), 'public://example_1.jpeg');
$file->setPermanent();
$file->save();
Expand Down Expand Up @@ -91,7 +90,7 @@ public function testOrganisationRendering(): void {
$this->drupalGet($node->toUrl());

// Assert page header - metadata.
$page_header = $this->assertSession()->elementExists('css', '.ecl-page-header.ecl-page-header--negative');
$page_header = $this->assertSession()->elementExists('css', '.ecl-page-header');
$assert = new PatternPageHeaderAssert();
$expected_values = [
'title' => 'My node title',
Expand Down Expand Up @@ -235,7 +234,7 @@ public function testOrganisationRendering(): void {
// Assert Leadership and organisation region is rendered.
$this->assertContentHeader($content_items[2], 'Leadership and organisation', 'leadership-and-organisation');
// Assert staff search link values.
$staff_search_link = $content_items[2]->findAll('css', 'a.ecl-link.ecl-link--standalone.ecl-link--icon.ecl-link--icon-after');
$staff_search_link = $content_items[2]->findAll('css', 'a.ecl-link.ecl-link--standalone.ecl-link--icon');
$this->assertCount(1, $staff_search_link);
$this->assertEquals('Search for staff', $staff_search_link[0]->find('css', '.ecl-link__label')->getText());
$staff_search_link[0]->hasLink('https://example.com');
Expand Down Expand Up @@ -269,7 +268,7 @@ public function testOrganisationRendering(): void {
$this->drupalGet($node->toUrl());

$content_items = $content->findAll('xpath', '/div');
$person_content = $content_items[2]->findAll('css', 'article.ecl-u-d-flex.ecl-u-pv-m.ecl-u-border-bottom.ecl-u-border-color-grey-15');
$person_content = $content_items[2]->findAll('css', 'article.ecl-u-d-flex.ecl-u-pv-m.ecl-u-border-bottom.ecl-u-border-color-neutral-40');
$this->assertCount(1, $person_content);
$this->assertStringContainsString('node/2', $person_content[0]->find('css', 'a.ecl-link.ecl-link--standalone')->getAttribute('href'));
// Assert person content.
Expand All @@ -288,8 +287,8 @@ public function testOrganisationRendering(): void {
$person->set('oe_person_jobs', [$person_job_1, $person_job_2]);
$person->save();
$this->getSession()->reload();
$person_content = $content_items[2]->findAll('css', 'article.ecl-u-d-flex.ecl-u-pv-m.ecl-u-border-bottom.ecl-u-border-color-grey-15');
$this->assertEquals('Adviser, Chief Adviser', $person_content[0]->find('css', '.ecl-content-item__meta.ecl-u-type-s.ecl-u-type-color-grey-75.ecl-u-mb-xs')->getText());
$person_content = $content_items[2]->findAll('css', 'article.ecl-u-d-flex.ecl-u-pv-m.ecl-u-border-bottom.ecl-u-border-color-neutral-40');
$this->assertEquals('Adviser, Chief Adviser', $person_content[0]->find('css', '.ecl-content-item__meta.ecl-u-type-s.ecl-u-type-color-dark-100.ecl-u-mb-xs')->getText());
}

}
1 change: 0 additions & 1 deletion tests/src/Kernel/OrganisationRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ protected function setUp(): void {
* Test a organisation being rendered as a teaser.
*/
public function testOrganisationTeaser(): void {
$this->markTestSkipped('Must be re-enabled before considering migration to ECL 4 as complete.');
$logo_media = $this->createMediaImage('organisation_logo');
$first_contact = $this->createContactEntity('first_contact', 'oe_general');

Expand Down