test: verify committed staging mutations reliably

This commit is contained in:
SimpleTest 2026-07-20 19:04:30 +03:00
parent 09575bfcba
commit 9463009b90
2 changed files with 18 additions and 6 deletions

View File

@ -32,10 +32,18 @@ test("registration, email confirmation, password, and email change work end to e
const passwordForm = user.page.locator("#update_password");
await passwordForm.getByLabel("New password", { exact: true }).fill(password);
await passwordForm.getByLabel("Confirm new password", { exact: true }).fill(password);
await clickUntilVisible(
passwordForm.getByRole("button", { name: "Save Password" }),
user.page.getByText("Password updated successfully."),
);
const passwordUpdated = user.page.getByText("Password updated successfully.");
await passwordForm.getByRole("button", { name: "Save Password" }).click();
try {
await expect(passwordUpdated).toBeVisible({ timeout: 5_000 });
} catch {
// The password commit rotates the current session. If the following GET
// is interrupted after the 302 response, never submit the mutation again:
// recover through an idempotent page and verify the server-side flash.
await gotoWithTransientRetry(user.page, "/users/settings");
await expect(passwordUpdated).toBeVisible();
}
const emailForm = user.page.locator("#update_email");
await emailForm.getByLabel("Email").fill(changedEmail);

View File

@ -108,7 +108,9 @@ test("two users complete medicine tracking, handover, realtime chat, and blind r
await helper.page.getByLabel("Comment (optional)").fill("Clear and safe coordination.");
await helper.page.getByRole("button", { name: "Submit review" }).click();
await expect(
helper.page.getByText("Review saved. It appears after both participants review."),
helper.page
.locator("#main-content")
.getByText("Review saved. It appears after both participants review."),
).toBeVisible();
await waitForMapReady(requester.page);
@ -121,7 +123,9 @@ test("two users complete medicine tracking, handover, realtime chat, and blind r
await requester.page.getByLabel("Comment (optional)").fill("Reliable volunteer.");
await requester.page.getByRole("button", { name: "Submit review" }).click();
await expect(
requester.page.getByText("Review saved. It appears after both participants review."),
requester.page
.locator("#main-content")
.getByText("Review saved. It appears after both participants review."),
).toBeVisible();
await waitForMapReady(requester.page);