mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-25 02:26:12 +02:00
test(e2e): await chat lifecycle request completion
Poll the same exact lifecycle action sequence after asynchronous browser clicks so CI does not assert before the resume request reaches the mock. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
2d2772f279
commit
ae5ffd0185
1 file changed
+3
-3
@@ -75,7 +75,7 @@ async function exerciseGitHubReviewSetup(page: Page, mock: ChatMock, seed: Seed,
|
||||
await page.getByText("Connection health and controls", { exact: true }).click();
|
||||
await page.getByRole("button", { name: "Pause", exact: true }).click();
|
||||
await page.getByRole("button", { name: "Resume", exact: true }).click();
|
||||
expect(mock.lifecycleActions).toEqual(["pause", "resume"]);
|
||||
await expect.poll(() => mock.lifecycleActions).toEqual(["pause", "resume"]);
|
||||
await page.getByRole("button", { name: "Replay failed delivery", exact: true }).click();
|
||||
await expect.poll(() => mock.replayedDelivery).toBe(true);
|
||||
mock.setStatus("attention");
|
||||
@@ -651,7 +651,7 @@ test.describe.serial("native chat adapter UI", () => {
|
||||
await expect(
|
||||
page.getByRole("button", { name: "Pause", exact: true }),
|
||||
).toBeVisible();
|
||||
expect(mock.lifecycleActions).toEqual(["pause", "resume"]);
|
||||
await expect.poll(() => mock.lifecycleActions).toEqual(["pause", "resume"]);
|
||||
|
||||
mock.setStatus("attention");
|
||||
await page.reload();
|
||||
@@ -776,7 +776,7 @@ test.describe.serial("native chat adapter UI", () => {
|
||||
.click();
|
||||
await expect(page).toHaveURL(new RegExp(`/${seed.prefix}/apps$`));
|
||||
await expect.poll(() => mock.removed).toBe(true);
|
||||
expect(mock.lifecycleActions).toEqual(["pause", "resume", "remove"]);
|
||||
await expect.poll(() => mock.lifecycleActions).toEqual(["pause", "resume", "remove"]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user