mirror of
https://github.com/suitenumerique/docs.git
synced 2026-09-27 03:55:01 +02:00
✅(frontend) wait for editor mount in createDoc e2e helper
createDoc returned before the ProseMirror editor was visible, so tests that immediately typed or opened the presenter raced the load. Wait for the editor container before handing control back.
This commit is contained in:
@@ -180,6 +180,12 @@ export const createDoc = async (
|
||||
expect(responseUpdateDoc.ok()).toBeTruthy();
|
||||
}
|
||||
|
||||
// Wait for the editor to be mounted before handing control back, so callers
|
||||
// that immediately type or open features don't race the editor load.
|
||||
await expect(
|
||||
page.locator('.--docs--editor-container .ProseMirror'),
|
||||
).toBeVisible({ timeout: 10000 });
|
||||
|
||||
return randomDocs;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user