Skip to content

Commit

Permalink
EWPP-4693: Fix assertion for html elements stripping exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergepavle authored and upchuk committed Sep 3, 2024
1 parent 248c2c6 commit 78e9d33
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,14 @@ public function setUp(): void {
*/
public function testNodeRoutes(): void {
// Create a published revision for a node.
$published_revision_body = $this->randomString() . '<mark>published</mark>';
$published_revision_body = '<u>Custom page</u> introduction with <sub>rich</sub><sup>text</sup><mark>highlighted</mark>.';
$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');
Expand All @@ -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.
Expand All @@ -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());
}

}

0 comments on commit 78e9d33

Please sign in to comment.