Skip to content
Snippets Groups Projects

Issue #3308432 by devkinetic: The link on the Image tag is redirecting to an...

Closed Issue #3308432 by devkinetic: The link on the Image tag is redirecting to an...
All threads resolved!
All threads resolved!
2 files
+ 17
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -54,15 +54,29 @@ public function testPreviewLinks(): void {
$assertSession = $this->assertSession();
$this->drupalGet('node/add/test');
$this->submitForm([
'title[0][value]' => 'Test node',
'body[0][value]' => '<a href="#foo">Anchor link</a><a href="/foo">Normal link</a>',
'title[0][value]' => 'Test anchor link',
'body[0][value]' => '<a href="#foo">Anchor link</a>',
], 'Preview');
$this->clickLink('Anchor link');
$assertSession->pageTextNotContains('Leave preview?');
$this->drupalGet('node/add/test');
$this->submitForm([
'title[0][value]' => 'Test normal link',
'body[0][value]' => '<a href="/foo">Normal link</a>',
], 'Preview');
$this->clickLink('Normal link');
$assertSession->pageTextContains('Leave preview?');
$this->click('button:contains("Leave preview")');
$this->assertStringEndsWith('/foo', $this->getUrl());
$this->drupalGet('node/add/test');
$this->submitForm([
'title[0][value]' => 'Test child element link',
'body[0][value]' => '<a href="/foo" class="preview-child-element"><span>Child element link</span></a>',
], 'Preview');
$this->getSession()->getPage()->find('css', '.preview-child-element span')->click();
$assertSession->pageTextContains('Leave preview?');
$this->click('button:contains("Leave preview")');
$this->assertStringEndsWith('/foo', $this->getUrl());
}
}
Loading