element.
+ $this->selectTextInsideElement('.ck-editor__editable a em');
+ $this->pressEditorButton('Insert non-breaking space');
+
+ $this->assertNotEmpty($assert_session->waitForElement('css', '.ck-editor__editable a em > nbsp'));
+ $this->assertEquals('lorem ipsum dolore
dolo amet.
', $editor->getHtml());
+
+ // The link should be left intact and we should have 1 NBSP element inside.
+ $xpath = new \DOMXPath($this->getEditorDataAsDom());
+ $nbsp = $xpath->query('//nbsp');
+ $this->assertCount(1, $nbsp);
+ $this->assertEquals(" ", $nbsp[0]->firstChild->nodeValue);
+ $link = $xpath->query('//a');
+ $this->assertCount(1, $link);
+ $this->assertEquals("dolore dolo", $link[0]->textContent);
+ }
+
}