mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
test: add tests for streetwriters/notesnook#279
This commit is contained in:
@@ -132,7 +132,7 @@ test("format changes should get saved", async () => {
|
|||||||
|
|
||||||
await page.waitForSelector(".mce-content-body");
|
await page.waitForSelector(".mce-content-body");
|
||||||
|
|
||||||
await page.keyboard.press("Control+a");
|
await page.keyboard.press("Shift+End");
|
||||||
|
|
||||||
await page.click(`#editorToolbar button[title="Bold"]`);
|
await page.click(`#editorToolbar button[title="Bold"]`);
|
||||||
|
|
||||||
@@ -206,3 +206,25 @@ test("select all & backspace should clear all content in editor", async () => {
|
|||||||
|
|
||||||
await expect(getEditorContent()).resolves.toBe("");
|
await expect(getEditorContent()).resolves.toBe("");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.only("last line doesn't get saved if it's font is different", async () => {
|
||||||
|
const selector = await createNoteAndCheckPresence();
|
||||||
|
|
||||||
|
await page.keyboard.press("Enter");
|
||||||
|
|
||||||
|
await page.click(`#editorToolbar button[title="Fonts"]`);
|
||||||
|
|
||||||
|
await page.click(`div[title="Serif"]`);
|
||||||
|
|
||||||
|
await page.type(".mce-content-body", "I am another line in Serif font.");
|
||||||
|
|
||||||
|
await page.waitForTimeout(200);
|
||||||
|
|
||||||
|
await page.click(getTestId("notes-action-button"));
|
||||||
|
|
||||||
|
await page.click(selector);
|
||||||
|
|
||||||
|
const content = await getEditorContentAsHTML();
|
||||||
|
|
||||||
|
expect(content).toMatchSnapshot(`last-line-with-different-font.txt`);
|
||||||
|
});
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<p>This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1<br></p>
|
<p><strong>This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1</strong><br></p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1<span id="_mce_caret" data-mce-bogus="1"><span style="font-family: serif;">I am another line in Serif font.</span></span></p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1<span id="_mce_caret" data-mce-bogus="1"><span style="font-family: serif;">I am another line in Serif font.</span></span><br></p>
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<p>This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1<span id="_mce_caret" data-mce-bogus="1"><span style="font-family: serif;">I am another line in Serif font.</span></span></p>
|
||||||
Reference in New Issue
Block a user