Wait for the notepad write before reloading in the session E2E
This commit is contained in:
parent
cf01e4f67e
commit
fd95e4ccff
2 changed files with 9 additions and 0 deletions
|
|
@ -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([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue