A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
web: move topic tests from notebook test suite
Abdullah Attac3aa2dd62bc4
diff --git a/apps/web/__e2e__/notebooks.test.ts b/apps/web/__e2e__/notebooks.test.tsindex 2158901c6..5d5732eae 100644--- a/apps/web/__e2e__/notebooks.test.ts+++ b/apps/web/__e2e__/notebooks.test.ts@@ -19,7 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { test, expect } from "@playwright/test";import { AppModel } from "./models/app.model";-import { Item, Notebook } from "./models/types";+import { Notebook } from "./models/types";import {groupByOptions,NOTE,@@ -70,26 +70,6 @@ test("edit a notebook", async ({ page }) => {expect(await editedNotebook?.getDescription()).toBe(item.description);});-test("edit topics individually", async ({ page }) => {- const app = new AppModel(page);- await app.goto();- const notebooks = await app.goToNotebooks();- const notebook = await notebooks.createNotebook(NOTEBOOK);- const topics = await notebook?.openNotebook();-- const editedTopics: Item[] = [];- for (const title of NOTEBOOK.topics) {- const topic = await topics?.findItem({ title });- const editedTopic: Item = { title: `${title} (edited)` };- await topic?.editItem(editedTopic);- editedTopics.push(editedTopic);- }-- for (const topic of editedTopics) {- expect(await topics?.findItem(topic)).toBeDefined();- }-});-test("delete a notebook", async ({ page }) => {const app = new AppModel(page);await app.goto();@@ -104,20 +84,6 @@ test("delete a notebook", async ({ page }) => {expect(await trash.findItem(NOTEBOOK.title)).toBeDefined();});-test("delete a topic", async ({ page }) => {- const app = new AppModel(page);- await app.goto();- const notebooks = await app.goToNotebooks();- const notebook = await notebooks.createNotebook(NOTEBOOK);- const topics = await notebook?.openNotebook();- const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });-- await topic?.delete();-- expect(await app.toasts.waitForToast("1 topic deleted")).toBe(true);- expect(await topics?.findItem({ title: NOTEBOOK.topics[0] })).toBeUndefined();-});-test("restore a notebook", async ({ page }) => {const app = new AppModel(page);await app.goto();@@ -199,37 +165,6 @@ test("remove shortcut of a notebook", async ({ page }) => {expect(allShortcuts.includes(NOTEBOOK.title)).toBeFalsy();});-test("create shortcut of a topic", async ({ page }) => {- const app = new AppModel(page);- await app.goto();- const notebooks = await app.goToNotebooks();- const notebook = await notebooks.createNotebook(NOTEBOOK);- const topics = await notebook?.openNotebook();- const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });-- await topic?.createShortcut();-- expect(await topic?.isShortcut()).toBe(true);- const allShortcuts = await app.navigation.getShortcuts();- expect(allShortcuts.includes(NOTEBOOK.topics[0])).toBeTruthy();-});--test("remove shortcut of a topic", async ({ page }) => {- const app = new AppModel(page);- await app.goto();- const notebooks = await app.goToNotebooks();- const notebook = await notebooks.createNotebook(NOTEBOOK);- const topics = await notebook?.openNotebook();- const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });- await topic?.createShortcut();-- await topic?.removeShortcut();-- expect(await topic?.isShortcut()).toBe(false);- const allShortcuts = await app.navigation.getShortcuts();- expect(allShortcuts.includes(NOTEBOOK.topics[0])).toBeFalsy();-});-test(`sort notebooks`, async ({ page }, info) => {info.setTimeout(60 * 1000);diff --git a/apps/web/__e2e__/topics.test.ts b/apps/web/__e2e__/topics.test.tsindex 19e8f923b..d6c2d1f85 100644--- a/apps/web/__e2e__/topics.test.ts+++ b/apps/web/__e2e__/topics.test.ts@@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { test, expect } from "@playwright/test";import { AppModel } from "./models/app.model";+import { Item } from "./models/types";import {groupByOptions,NOTEBOOK,@@ -26,6 +27,71 @@ import {orderByOptions} from "./utils";+test("create shortcut of a topic", async ({ page }) => {+ const app = new AppModel(page);+ await app.goto();+ const notebooks = await app.goToNotebooks();+ const notebook = await notebooks.createNotebook(NOTEBOOK);+ const topics = await notebook?.openNotebook();+ const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });++ await topic?.createShortcut();++ expect(await topic?.isShortcut()).toBe(true);+ const allShortcuts = await app.navigation.getShortcuts();+ expect(allShortcuts.includes(NOTEBOOK.topics[0])).toBeTruthy();+});++test("remove shortcut of a topic", async ({ page }) => {+ const app = new AppModel(page);+ await app.goto();+ const notebooks = await app.goToNotebooks();+ const notebook = await notebooks.createNotebook(NOTEBOOK);+ const topics = await notebook?.openNotebook();+ const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });+ await topic?.createShortcut();++ await topic?.removeShortcut();++ expect(await topic?.isShortcut()).toBe(false);+ const allShortcuts = await app.navigation.getShortcuts();+ expect(allShortcuts.includes(NOTEBOOK.topics[0])).toBeFalsy();+});++test("delete a topic", async ({ page }) => {+ const app = new AppModel(page);+ await app.goto();+ const notebooks = await app.goToNotebooks();+ const notebook = await notebooks.createNotebook(NOTEBOOK);+ const topics = await notebook?.openNotebook();+ const topic = await topics?.findItem({ title: NOTEBOOK.topics[0] });++ await topic?.delete();++ expect(await app.toasts.waitForToast("1 topic deleted")).toBe(true);+ expect(await topics?.findItem({ title: NOTEBOOK.topics[0] })).toBeUndefined();+});++test("edit topics individually", async ({ page }) => {+ const app = new AppModel(page);+ await app.goto();+ const notebooks = await app.goToNotebooks();+ const notebook = await notebooks.createNotebook(NOTEBOOK);+ const topics = await notebook?.openNotebook();++ const editedTopics: Item[] = [];+ for (const title of NOTEBOOK.topics) {+ const topic = await topics?.findItem({ title });+ const editedTopic: Item = { title: `${title} (edited)` };+ await topic?.editItem(editedTopic);+ editedTopics.push(editedTopic);+ }++ for (const topic of editedTopics) {+ expect(await topics?.findItem(topic)).toBeDefined();+ }+});+test(`sort topics`, async ({ page }, info) => {info.setTimeout(60 * 1000);