mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-03 10:13:47 +10:00
test(e2e): wait for the assistant to settle and for focus to return
Enter in the composer is ignored until the previous reply has finished, so the helper presses again until the message goes; the palette's focus return is polled rather than read once.
This commit is contained in:
@@ -37,7 +37,11 @@ async function send(page: Page, text: string) {
|
||||
await expect(page.getByRole("button", { name: "Send" }).last()).toBeVisible({ timeout: 20_000 });
|
||||
const composer = page.getByLabel("Message the assistant");
|
||||
await composer.fill(text);
|
||||
await composer.press("Enter");
|
||||
// Enter is ignored until the previous reply has fully settled; the text stays, so press again.
|
||||
await expect(async () => {
|
||||
if ((await composer.inputValue()) !== "") await composer.press("Enter");
|
||||
await expect(composer).toHaveValue("", { timeout: 1_000 });
|
||||
}).toPass({ timeout: 20_000 });
|
||||
}
|
||||
|
||||
test("proposes edits that change nothing until accepted, asks before assuming, and stops", async ({
|
||||
|
||||
@@ -45,5 +45,5 @@ test("sheets, panels and dialogs return focus to what opened them", async ({ aut
|
||||
await page.keyboard.press("Enter");
|
||||
await expect(page.getByRole("dialog")).toBeVisible();
|
||||
await page.keyboard.press("Escape");
|
||||
expect(await focusedName(page)).toMatch(/Search or run/);
|
||||
await expect.poll(() => focusedName(page)).toMatch(/Search or run/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user