From 85b7760e1ee2eab9da12f6104e901c47812e77b9 Mon Sep 17 00:00:00 2001 From: 01zulfi <85733202+01zulfi@users.noreply.github.com> Date: Fri, 2 May 2025 10:11:53 +0500 Subject: [PATCH] web: add more archive test cases (#8040) Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com> --- apps/web/__e2e__/models/app.model.ts | 4 ---- apps/web/__e2e__/notes.test.ts | 32 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 4 deletions(-) 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(); +});