test(server-e2e): fix test for new create note option

This commit is contained in:
Jakob Schlanstedt 2025-11-03 19:48:44 +01:00 committed by Jakob Schlanstedt
parent b8367600ad
commit a787afcf54

View file

@ -8,6 +8,7 @@ interface GotoOpts {
}
const BASE_URL = "http://127.0.0.1:8082";
const NUM_OF_CREATE_NOTE_OPTIONS = 2;
interface DropdownLocator extends Locator {
selectOptionByText: (text: string) => Promise<void>;
@ -73,7 +74,8 @@ export default class App {
const resultsSelector = this.currentNoteSplit.locator(".note-detail-empty-results");
await expect(resultsSelector).toContainText(noteTitle);
await resultsSelector.locator(".aa-suggestion", { hasText: noteTitle })
.nth(1) // Select the second one, as the first one is "Create a new note"
// Select the n+1 one, as the first one is "Create a new note"
.nth(NUM_OF_CREATE_NOTE_OPTIONS)
.click();
}