diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-discounted-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-discounted-prices-Firefox-win32.txt new file mode 100644 index 000000000..fb80a9428 --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-discounted-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: ₹300 +Sales tax: ₹200 +Discount: -₹300 +Total: ₹300 \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-prices-Firefox-win32.txt new file mode 100644 index 000000000..e00d854bd --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-IN-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: ₹300 +Sales tax: ₹200 +Discount: ₹0 +Total: ₹300/mo \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-discounted-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-discounted-prices-Firefox-win32.txt new file mode 100644 index 000000000..dc7d77815 --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-discounted-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: $100 +Sales tax: $0 +Discount: -$100 +Total: $100 \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-prices-Firefox-win32.txt new file mode 100644 index 000000000..4e306caf8 --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-monthly-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: $100 +Sales tax: $0 +Discount: $0 +Total: $100/mo \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-discounted-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-discounted-prices-Firefox-win32.txt new file mode 100644 index 000000000..e06f69aad --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-discounted-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: ₹400 +Sales tax: ₹300 +Discount: -₹400 +Total: ₹400 \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-prices-Firefox-win32.txt new file mode 100644 index 000000000..b7156a025 --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-IN-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: ₹400 +Sales tax: ₹300 +Discount: ₹0 +Total: ₹400/yr \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-discounted-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-discounted-prices-Firefox-win32.txt new file mode 100644 index 000000000..fbbb62387 --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-discounted-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: $200 +Sales tax: $0 +Discount: -$200 +Total: $200 \ No newline at end of file diff --git a/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-prices-Firefox-win32.txt b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-prices-Firefox-win32.txt new file mode 100644 index 000000000..e68c773bf --- /dev/null +++ b/apps/web/__e2e__/checkout.test.ts-snapshots/checkout-yearly-prices-Firefox-win32.txt @@ -0,0 +1,4 @@ +Subtotal: $200 +Sales tax: $0 +Discount: $0 +Total: $200/yr \ No newline at end of file diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/dark-focus-mode-Firefox-win32.jpg b/apps/web/__e2e__/editor.test.ts-snapshots/dark-focus-mode-Firefox-win32.jpg new file mode 100644 index 000000000..e8735317b Binary files /dev/null and b/apps/web/__e2e__/editor.test.ts-snapshots/dark-focus-mode-Firefox-win32.jpg differ diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-1-Firefox-win32.txt b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-1-Firefox-win32.txt new file mode 100644 index 000000000..c5c3d9a70 --- /dev/null +++ b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-1-Firefox-win32.txt @@ -0,0 +1 @@ +Test note 1 (9) Test note 1 (8) Test note 1 (7) Test note 1 (6) Test note 1 (5) Test note 1 (4) Test note 1 (3) Test note 1 (2) Test note 1 (1) Test note 1 (0) 53ad8e4e40ebebd0f400498d \ No newline at end of file diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-2-Firefox-win32.txt b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-2-Firefox-win32.txt new file mode 100644 index 000000000..0365eeded --- /dev/null +++ b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-2-Firefox-win32.txt @@ -0,0 +1 @@ +Test note 2 (9)Test note 2 (8)Test note 2 (7)Test note 2 (6)Test note 2 (5)Test note 2 (4)Test note 2 (3)Test note 2 (2)Test note 2 (1)Test note 2 (0)f054d19e9a2f46eff7b9bb25 \ No newline at end of file diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-1-Firefox-win32.txt b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-1-Firefox-win32.txt new file mode 100644 index 000000000..1b6dba491 --- /dev/null +++ b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-1-Firefox-win32.txt @@ -0,0 +1 @@ +Test note 1Test note 1 (0) Test note 1 (1) Test note 1 (2) Test note 1 (3) Test note 1 (4) Test note 1 (5) Test note 1 (6) Test note 1 (7) Test note 1 (8) Test note 1 (9) \ No newline at end of file diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-2-Firefox-win32.txt b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-2-Firefox-win32.txt new file mode 100644 index 000000000..92705d03c --- /dev/null +++ b/apps/web/__e2e__/editor.test.ts-snapshots/fast-switch-and-edit-note-title-2-Firefox-win32.txt @@ -0,0 +1 @@ +Test note 2Test note 2 (0)Test note 2 (1)Test note 2 (2)Test note 2 (3)Test note 2 (4)Test note 2 (5)Test note 2 (6)Test note 2 (7)Test note 2 (8)Test note 2 (9) \ No newline at end of file diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/focus-mode-Firefox-win32.jpg b/apps/web/__e2e__/editor.test.ts-snapshots/focus-mode-Firefox-win32.jpg new file mode 100644 index 000000000..4637bcc1a Binary files /dev/null and b/apps/web/__e2e__/editor.test.ts-snapshots/focus-mode-Firefox-win32.jpg differ diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/light-focus-mode-Firefox-win32.jpg b/apps/web/__e2e__/editor.test.ts-snapshots/light-focus-mode-Firefox-win32.jpg new file mode 100644 index 000000000..7d4f04535 Binary files /dev/null and b/apps/web/__e2e__/editor.test.ts-snapshots/light-focus-mode-Firefox-win32.jpg differ diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/normal-mode-from-focus-mode-Firefox-win32.jpg b/apps/web/__e2e__/editor.test.ts-snapshots/normal-mode-from-focus-mode-Firefox-win32.jpg new file mode 100644 index 000000000..070567526 Binary files /dev/null and b/apps/web/__e2e__/editor.test.ts-snapshots/normal-mode-from-focus-mode-Firefox-win32.jpg differ diff --git a/apps/web/__e2e__/editor.test.ts-snapshots/readonly-edited-note-Firefox-win32.txt b/apps/web/__e2e__/editor.test.ts-snapshots/readonly-edited-note-Firefox-win32.txt new file mode 100644 index 000000000..8fdeb8f1c --- /dev/null +++ b/apps/web/__e2e__/editor.test.ts-snapshots/readonly-edited-note-Firefox-win32.txt @@ -0,0 +1 @@ +An edit I madeThis is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 \ No newline at end of file diff --git a/apps/web/__e2e__/models/note-item.model.ts b/apps/web/__e2e__/models/note-item.model.ts index 7ce3033df..fe401da12 100644 --- a/apps/web/__e2e__/models/note-item.model.ts +++ b/apps/web/__e2e__/models/note-item.model.ts @@ -41,9 +41,7 @@ export class NoteItemModel extends BaseItemModel { async openNote() { await this.click(); const title = await this.getTitle(); - const description = await this.getDescription(); - - await this.editor.waitForLoading(title, description); + await this.editor.waitForLoading(title); } async openLockedNote(password: string) { diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Firefox-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Firefox-win32.txt new file mode 100644 index 000000000..8d41c231e --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Firefox-win32.txt @@ -0,0 +1,163 @@ + + + + + + + Test 1 - Notesnook + + + + + + + + + +

Test 1

+

This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1

+ + diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Firefox-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Firefox-win32.txt new file mode 100644 index 000000000..ef91db9ea --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Firefox-win32.txt @@ -0,0 +1,7 @@ +# Test 1 + +This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 + + +--- + diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Firefox-win32.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Firefox-win32.txt new file mode 100644 index 000000000..aa657e922 --- /dev/null +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Firefox-win32.txt @@ -0,0 +1,7 @@ +Test 1 +---------- + +This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 + +---------- +Tags: \ No newline at end of file diff --git a/apps/web/__e2e__/sync.test.ts b/apps/web/__e2e__/sync.test.ts index 4f9521195..48d8bb4f9 100644 --- a/apps/web/__e2e__/sync.test.ts +++ b/apps/web/__e2e__/sync.test.ts @@ -50,10 +50,10 @@ const NOTE = { title: "Real-time sync test note 1" }; -test("edits in a note opened on 2 devices should sync in real-time", async ({ +test(`edits in a note opened on 2 devices should sync in real-time`, async ({ browser }, info) => { - info.setTimeout(60 * 1000); + info.setTimeout(70 * 1000); const newContent = makeid(24).repeat(2); const [deviceA, deviceB] = await Promise.all([ @@ -69,16 +69,15 @@ test("edits in a note opened on 2 devices should sync in real-time", async ({ const noteA = await notesA.findNote(NOTE); await Promise.all([noteA, noteB].map((note) => note?.openNote())); - await notesB.editor.clear(); + await actAndSync([deviceA, deviceB], notesB.editor.clear()); + expect(await notesA.editor.getContent("text")).toBe(""); + expect(await notesB.editor.getContent("text")).toBe(""); await actAndSync([deviceA, deviceB], notesB.editor.setContent(newContent)); - const [afterContentA, afterContentB] = await Promise.all( - [notesA, notesB].map((notes) => notes?.editor.getContent("text")) - ); expect(noteA).toBeDefined(); expect(noteB).toBeDefined(); - expect(afterContentA).toBe(newContent); - expect(afterContentB).toBe(newContent); + expect(await notesA.editor.getContent("text")).toBe(newContent); + expect(await notesB.editor.getContent("text")).toBe(newContent); }); function makeid(length: number) { diff --git a/apps/web/src/components/editor/tiptap.tsx b/apps/web/src/components/editor/tiptap.tsx index 458f08f57..bdb1b8946 100644 --- a/apps/web/src/components/editor/tiptap.tsx +++ b/apps/web/src/components/editor/tiptap.tsx @@ -431,7 +431,7 @@ function toIEditor(editor: Editor): IEditor { tr.setMeta("preventSave", true); return true; }) - .setContent(content, true, { preserveWhitespace: true }) + .setContent(content, false, { preserveWhitespace: true }) .setTextSelection({ from, to