Keep the space of the line-break note under the image box.

An invisible copy of the note sits under the image box, so the page
does not jump when the tabs change.
This commit is contained in:
tim
2026-09-26 15:27:51 +02:00
parent f5b41a09d6
commit 4657088d23
3 changed files with 30 additions and 7 deletions
+14
View File
@@ -28,6 +28,20 @@ class SubmitTest extends PageTestCase {
$this->assertStringContainsString('<script type="text/javascript" src="../publish/editor.js"></script>', $page['body']);
}
public function testTheImageTabKeepsTheSpaceOfTheNote(): void {
$html = new \DOMDocument();
$html->loadHTML($this->get('/publish')['body'], LIBXML_NOERROR);
$xpath = new \DOMXPath($html);
$note = $xpath->query('//div[@id="textparent"]/div[@class="note"]');
$spacer = $xpath->query('//div[@id="uploadparent"]/div[@class="note spacer"][@aria-hidden="true"]');
$this->assertCount(1, $note);
$this->assertCount(1, $spacer);
$this->assertSame($note[0]->textContent, $spacer[0]->textContent);
$this->assertCount(1, $xpath->query('//div[@id="uploadparent"]/div[@class="upload"]//input[@id="upload"]'));
// Both tabs sit in the same column
$this->assertCount(2, $xpath->query('//div[@class="textarea rightcolumn"]/div[@id="textparent" or @id="uploadparent"]'));
}
public function testEditorsGetNoCaptcha(): void {
$this->loginAs();
$body = $this->get('/publish')['body'];