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-3877: Reactivate page content type tests. #1386

Merged
merged 2 commits into from
Feb 1, 2024
Merged
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
7 changes: 3 additions & 4 deletions tests/src/Kernel/LegacyContentRenderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ class LegacyContentRenderTest extends ContentRenderTestBase {
* Tests that the Page node type is rendered with the correct ECL markup.
*/
public function testPage(): void {
$this->markTestSkipped('Must be re-enabled before considering migration to ECL 4 as complete.');
$node = $this->nodeStorage->create([
'type' => 'oe_news',
'type' => 'oe_page',
'title' => 'Test page node',
'body' => 'Body',
'oe_subject' => 'http://data.europa.eu/uxp/1000',
Expand Down Expand Up @@ -56,15 +55,15 @@ public function testPage(): void {
// Related links.
$related_links_heading = $crawler->filter('.ecl-u-type-heading-2');
$this->assertStringContainsString('Related links', $related_links_heading->text());
$related_links = $crawler->filter('div.ecl-u-border-bottom.ecl-u-border-color-grey-15.ecl-u-pt-m.ecl-u-pb-m a');
$related_links = $crawler->filter('div.ecl-u-border-bottom.ecl-u-border-color-neutral-40.ecl-u-pt-m.ecl-u-pb-m a');
22Alexandra marked this conversation as resolved.
Show resolved Hide resolved
$this->assertCount(2, $related_links);

// Test short title fallback.
$node->set('oe_content_short_title', 'Page short title')->save();
$build = $this->nodeViewBuilder->view($node, 'teaser');
$html = $this->renderRoot($build);
$crawler = new Crawler($html);
$title = $crawler->filter('div.ecl-content-item__content-block h1.ecl-content-block__title');
$title = $crawler->filter('a.ecl-link.ecl-link--standalone');
$this->assertEquals('Page short title', $title->text());
}

Expand Down