From fd399e96922bd24fa27e925759b80b6e7f34bec0 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Fri, 29 Nov 2024 13:58:26 -0300 Subject: [PATCH] fix: Update promptModalComponent.spec.ts to use waitForSelector instead of waitForTimeout (#4920) - Replaced the usage of waitForTimeout with waitForSelector in promptModalComponent.spec.ts to improve reliability and stability of the tests. --- src/frontend/tests/core/unit/promptModalComponent.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/frontend/tests/core/unit/promptModalComponent.spec.ts b/src/frontend/tests/core/unit/promptModalComponent.spec.ts index 68bd0d499..c774d2b94 100644 --- a/src/frontend/tests/core/unit/promptModalComponent.spec.ts +++ b/src/frontend/tests/core/unit/promptModalComponent.spec.ts @@ -25,7 +25,9 @@ test( while (modalCount === 0) { await page.getByText("New Flow", { exact: true }).click(); - await page.waitForTimeout(3000); + await page.waitForSelector('[data-testid="modal-title"]', { + timeout: 3000, + }); modalCount = await page.getByTestId("modal-title")?.count(); } await page.waitForSelector('[data-testid="blank-flow"]', { @@ -35,7 +37,9 @@ test( await page.getByTestId("sidebar-search-input").click(); await page.getByTestId("sidebar-search-input").fill("prompt"); - await page.waitForTimeout(1000); + await page.waitForSelector('[data-testid="promptsPrompt"]', { + timeout: 3000, + }); await page .locator('//*[@id="promptsPrompt"]')