test: stabilize untitled auto-rename smoke

This commit is contained in:
lucaronin
2026-04-14 12:16:50 +02:00
parent 62154535c0
commit 76fe4611c2

View File

@@ -38,7 +38,7 @@ async function createUntitledNote(page: Page): Promise<void> {
await expect(page.getByTestId('breadcrumb-filename-trigger')).toContainText(/untitled-note-\d+(?:-\d+)?/i, {
timeout: 5_000,
})
await expectReadyEmptyTitleHeading(page)
await expectStableEmptyTitleHeading(page)
}
async function writeNewHeading(page: Page, title: string): Promise<void> {
@@ -104,6 +104,12 @@ async function expectReadyEmptyTitleHeading(page: Page): Promise<void> {
await expect.poll(() => selectionInsideEmptyTitleHeading(page), { timeout: 5_000 }).toBe(true)
}
async function expectStableEmptyTitleHeading(page: Page): Promise<void> {
await expectReadyEmptyTitleHeading(page)
await page.waitForTimeout(300)
await expectReadyEmptyTitleHeading(page)
}
let tempVaultDir: string
test.beforeEach(async ({ page }, testInfo) => {