test: verify committed staging mutations reliably
This commit is contained in:
parent
09575bfcba
commit
9463009b90
|
|
@ -32,10 +32,18 @@ test("registration, email confirmation, password, and email change work end to e
|
||||||
const passwordForm = user.page.locator("#update_password");
|
const passwordForm = user.page.locator("#update_password");
|
||||||
await passwordForm.getByLabel("New password", { exact: true }).fill(password);
|
await passwordForm.getByLabel("New password", { exact: true }).fill(password);
|
||||||
await passwordForm.getByLabel("Confirm new password", { exact: true }).fill(password);
|
await passwordForm.getByLabel("Confirm new password", { exact: true }).fill(password);
|
||||||
await clickUntilVisible(
|
const passwordUpdated = user.page.getByText("Password updated successfully.");
|
||||||
passwordForm.getByRole("button", { name: "Save Password" }),
|
await passwordForm.getByRole("button", { name: "Save Password" }).click();
|
||||||
user.page.getByText("Password updated successfully."),
|
|
||||||
);
|
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");
|
const emailForm = user.page.locator("#update_email");
|
||||||
await emailForm.getByLabel("Email").fill(changedEmail);
|
await emailForm.getByLabel("Email").fill(changedEmail);
|
||||||
|
|
|
||||||
|
|
@ -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.getByLabel("Comment (optional)").fill("Clear and safe coordination.");
|
||||||
await helper.page.getByRole("button", { name: "Submit review" }).click();
|
await helper.page.getByRole("button", { name: "Submit review" }).click();
|
||||||
await expect(
|
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();
|
).toBeVisible();
|
||||||
|
|
||||||
await waitForMapReady(requester.page);
|
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.getByLabel("Comment (optional)").fill("Reliable volunteer.");
|
||||||
await requester.page.getByRole("button", { name: "Submit review" }).click();
|
await requester.page.getByRole("button", { name: "Submit review" }).click();
|
||||||
await expect(
|
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();
|
).toBeVisible();
|
||||||
|
|
||||||
await waitForMapReady(requester.page);
|
await waitForMapReady(requester.page);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user