Skip to content

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

web: add more archive test cases (#8040)

01zulfi85b7760e1ee2
diff --git a/apps/web/__e2e__/models/app.model.ts b/apps/web/__e2e__/models/app.model.ts
index 884229813..af61ccf77 100644
--- a/apps/web/__e2e__/models/app.model.ts
+++ b/apps/web/__e2e__/models/app.model.ts
@@ -159,12 +159,8 @@ export class AppModel {
async search(query: string, type: string) {
const searchinput = this.page.locator(getTestId("search-input"));
- const searchButton = this.page.locator(getTestId("search-button"));
- const openSearch = this.page.locator(getTestId("open-search"));
- await openSearch.click();
await searchinput.fill(query);
- await searchButton.click();
return new SearchViewModel(this.page, type);
}
}
diff --git a/apps/web/__e2e__/notes.test.ts b/apps/web/__e2e__/notes.test.ts
index 600da61ed..f33d79675 100644
--- a/apps/web/__e2e__/notes.test.ts
+++ b/apps/web/__e2e__/notes.test.ts
@@ -415,3 +415,35 @@ test("archived notebook note shouldn't be in notebooks note list", async ({
expect(await notes?.findNote(NOTE)).toBeUndefined();
});
+
+test("archived colored note shouldn't be in colors note list", async ({
+ page
+}) => {
+ const app = new AppModel(page);
+ await app.goto();
+ const notes = await app.goToNotes();
+ let note = await notes.createNote(NOTE);
+ await note?.contextMenu.newColor({ title: "red", color: "#ff0000" });
+ const color = await app.goToColor("red");
+
+ note = await color.findNote(NOTE);
+ expect(note).toBeDefined();
+ await note?.contextMenu.archive();
+
+ expect(await color.findNote(NOTE)).toBeUndefined();
+});
+
+test("archived note shouldn't appear in search results", async ({ page }) => {
+ const app = new AppModel(page);
+ await app.goto();
+ const notes = await app.goToNotes();
+ const note = await notes.createNote(NOTE);
+
+ await app.search(NOTE.title, "notes");
+ expect(await notes.findNote(NOTE)).toBeDefined();
+ await note?.contextMenu.archive();
+
+ await app.search(NOTE.title, "notes");
+ const searchedNote = await notes.findNote(NOTE);
+ expect(searchedNote).toBeUndefined();
+});