Wait for the notepad write before reloading in the session E2E
All checks were successful
Validate and deploy Sokko G / validate (push) Successful in 19m50s
Validate and deploy Sokko G / deploy (push) Successful in 9s

This commit is contained in:
Shinuwa 2026-11-06 16:19:26 +01:00
parent cf01e4f67e
commit fd95e4ccff
2 changed files with 9 additions and 0 deletions

View file

@ -86,6 +86,13 @@ test("notepad temporary drawings stay on their own pages and survive reload", as
await selectPage("c");
await expect.poll(() => alphaAt(20)).toBe(0);
await selectPage("a");
// L'interface change avant la fin de l'écriture : recharger trop tôt reviendrait à la page précédente.
// Le stockage omet l'identifiant quand la page active est la première.
await expect.poll(() => page.evaluate(async () => {
const db = await import("/src/utils/indexedDbStorage.js");
const [entry] = await db.getModuleDataEntries(["session-notes:note"]);
return entry?.data?.activePageId ?? entry?.data?.pages?.[0]?.id;
})).toBe("a");
await page.reload();
await expect.poll(() => alphaAt(20)).toBeGreaterThan(0);
expect(errors).toEqual([]);