Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

test: more editor tests

thecodrrd707d02cbd5d
diff --git a/apps/web/__e2e__/editor.test.js b/apps/web/__e2e__/editor.test.js
index fed10525a..3fd04426e 100644
--- a/apps/web/__e2e__/editor.test.js
+++ b/apps/web/__e2e__/editor.test.js
@@ -16,9 +16,63 @@ test("focus mode", async () => {
await page.click(getTestId("focus-mode"));
- await page.waitForTimeout(1000);
+ await page.waitForTimeout(500);
expect(
await page.screenshot({ fullPage: true, quality: 100, type: "jpeg" })
).toMatchSnapshot("focus-mode.jpg", { threshold: 99 });
});
+
+test("dark mode in focus mode", async () => {
+ await createNote(NOTE, "notes");
+
+ await page.click(getTestId("focus-mode"));
+
+ await page.waitForTimeout(500);
+
+ await page.click(getTestId("dark-mode"));
+
+ await page.waitForTimeout(1000);
+
+ expect(
+ await page.screenshot({ fullPage: true, quality: 100, type: "jpeg" })
+ ).toMatchSnapshot("dark-focus-mode.jpg", { threshold: 99 });
+
+ await page.click(getTestId("dark-mode"));
+
+ await page.waitForTimeout(1000);
+
+ expect(
+ await page.screenshot({ fullPage: true, quality: 100, type: "jpeg" })
+ ).toMatchSnapshot("light-focus-mode.jpg", { threshold: 99 });
+});
+
+test("full screen in focus mode", async () => {
+ await createNote(NOTE, "notes");
+
+ await page.click(getTestId("focus-mode"));
+
+ await page.waitForTimeout(500);
+
+ await page.click(getTestId("enter-fullscreen"));
+
+ await page.waitForTimeout(100);
+
+ await page.click(getTestId("exit-fullscreen"));
+});
+
+test("normal mode from focus mode", async () => {
+ await createNote(NOTE, "notes");
+
+ await page.click(getTestId("focus-mode"));
+
+ await page.waitForTimeout(500);
+
+ await page.click(getTestId("normal-mode"));
+
+ await page.waitForTimeout(1000);
+
+ expect(
+ await page.screenshot({ fullPage: true, quality: 100, type: "jpeg" })
+ ).toMatchSnapshot("normal-mode-from-focus-mode.jpg", { threshold: 99 });
+});
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Chromium-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Chromium-linux.jpg
new file mode 100644
index 000000000..a27caae4a
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Chromium-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Firefox-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Firefox-linux.jpg
new file mode 100644
index 000000000..b1aedd3f0
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-Firefox-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-WebKit-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-WebKit-linux.jpg
new file mode 100644
index 000000000..05f1a73d2
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/dark-focus-mode-WebKit-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-Chromium-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-Chromium-linux.jpg
index f91abfb4d..15448ecef 100644
Binary files a/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-Chromium-linux.jpg and b/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-Chromium-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-WebKit-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-WebKit-linux.jpg
index 63d65fd2f..95173bb1c 100644
Binary files a/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-WebKit-linux.jpg and b/apps/web/__e2e__/editor.test.js-snapshots/focus-mode-WebKit-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Chromium-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Chromium-linux.jpg
new file mode 100644
index 000000000..95b30b1ed
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Chromium-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Firefox-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Firefox-linux.jpg
new file mode 100644
index 000000000..b97b35b3d
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-Firefox-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-WebKit-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-WebKit-linux.jpg
new file mode 100644
index 000000000..085054260
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/light-focus-mode-WebKit-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Chromium-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Chromium-linux.jpg
new file mode 100644
index 000000000..6d46308fe
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Chromium-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Firefox-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Firefox-linux.jpg
new file mode 100644
index 000000000..5c4ab16f1
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-Firefox-linux.jpg differ
diff --git a/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-WebKit-linux.jpg b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-WebKit-linux.jpg
new file mode 100644
index 000000000..385780b3e
Binary files /dev/null and b/apps/web/__e2e__/editor.test.js-snapshots/normal-mode-from-focus-mode-WebKit-linux.jpg differ