mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
[Editor] Avoid to add a new line when hitting enter with a selected freetext editor
This commit is contained in:
parent
e914870c14
commit
8f6635bacf
2 changed files with 16 additions and 1 deletions
|
@ -104,7 +104,20 @@ describe("FreeText Editor", () => {
|
|||
await waitForSelectedEditor(page, getEditorSelector(0));
|
||||
await waitForStorageEntries(page, 1);
|
||||
|
||||
const content = await page.$eval(getEditorSelector(0), el =>
|
||||
let content = await page.$eval(getEditorSelector(0), el =>
|
||||
el.innerText.trimEnd()
|
||||
);
|
||||
expect(content).withContext(`In ${browserName}`).toEqual(data);
|
||||
|
||||
// Edit again.
|
||||
await page.keyboard.press("Enter");
|
||||
await page.waitForTimeout(10);
|
||||
|
||||
// Commit.
|
||||
await page.keyboard.press("Escape");
|
||||
await page.waitForTimeout(10);
|
||||
|
||||
content = await page.$eval(getEditorSelector(0), el =>
|
||||
el.innerText.trimEnd()
|
||||
);
|
||||
expect(content).withContext(`In ${browserName}`).toEqual(data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue