web: add more archive test cases (#8040)

Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
01zulfi
2025-05-02 10:11:53 +05:00
committed by Abdullah Atta
parent 40ee0ecf47
commit 85b7760e1e
2 changed files with 32 additions and 4 deletions

View File

@@ -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);
}
}

View File

@@ -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();
});