mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 05:40:49 +08:00
test(server-e2e): fix test for new create note option
This commit is contained in:
parent
b8367600ad
commit
a787afcf54
1 changed files with 3 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ interface GotoOpts {
|
||||||
}
|
}
|
||||||
|
|
||||||
const BASE_URL = "http://127.0.0.1:8082";
|
const BASE_URL = "http://127.0.0.1:8082";
|
||||||
|
const NUM_OF_CREATE_NOTE_OPTIONS = 2;
|
||||||
|
|
||||||
interface DropdownLocator extends Locator {
|
interface DropdownLocator extends Locator {
|
||||||
selectOptionByText: (text: string) => Promise<void>;
|
selectOptionByText: (text: string) => Promise<void>;
|
||||||
|
|
@ -73,7 +74,8 @@ export default class App {
|
||||||
const resultsSelector = this.currentNoteSplit.locator(".note-detail-empty-results");
|
const resultsSelector = this.currentNoteSplit.locator(".note-detail-empty-results");
|
||||||
await expect(resultsSelector).toContainText(noteTitle);
|
await expect(resultsSelector).toContainText(noteTitle);
|
||||||
await resultsSelector.locator(".aa-suggestion", { hasText: 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();
|
.click();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue