diff --git a/modules/oe_theme_helper/tests/src/Functional/NodeViewRoutesMetadataTest.php b/modules/oe_theme_helper/tests/src/Functional/NodeViewRoutesMetadataTest.php
index 5d5fe6404..188804bd1 100644
--- a/modules/oe_theme_helper/tests/src/Functional/NodeViewRoutesMetadataTest.php
+++ b/modules/oe_theme_helper/tests/src/Functional/NodeViewRoutesMetadataTest.php
@@ -81,11 +81,14 @@ public function setUp(): void {
*/
public function testNodeRoutes(): void {
// Create a published revision for a node.
- $published_revision_body = $this->randomString() . 'published';
+ $published_revision_body = 'Custom page introduction with richtexthighlighted.';
$node = $this->drupalCreateNode([
'type' => 'test',
'moderation_state' => 'published',
- 'body' => $published_revision_body,
+ 'body' => [
+ 'value' => $published_revision_body,
+ 'format' => 'full_html',
+ ],
]);
// Save the revision url for later access.
$first_revision_url = $node->toUrl('revision');
@@ -101,7 +104,7 @@ public function testNodeRoutes(): void {
// Verify that the page header block is shown in the node canonical route
// and contains the correct revision text.
$this->drupalGet($node->toUrl());
- $this->assertSession()->elementTextContains('css', '.ecl-page-header__description', $published_revision_body);
+ $this->assertEquals($published_revision_body, $this->getSession()->getPage()->find('css', '.ecl-page-header__description')->getHtml());
// Verify that the block is also shown in the latest version route with the
// correct draft revision loaded.
@@ -110,7 +113,7 @@ public function testNodeRoutes(): void {
// Verify also for the node single revision route.
$this->drupalGet($first_revision_url);
- $this->assertSession()->elementTextContains('css', '.ecl-page-header__description', $published_revision_body);
+ $this->assertEquals($published_revision_body, $this->getSession()->getPage()->find('css', '.ecl-page-header__description')->getHtml());
}
}