mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 12:12:54 +01:00
web: add more archive test cases (#8040)
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user