fix: form input not being saved after "back" (#11540)

Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
Nafees NazikandHariom Balhara authored and GitHub committed 2023-09-27 04:39:37 +00:00
1 parent 919066222b
commit ce13350d5d
2 files changed
+21 -1

No files matched your search

+17
View File
@@ -252,6 +252,23 @@ test.describe("prefill", () => {
});
});
test("Persist the field values when going back and coming back to the booking form", async ({
page,
users,
}) => {
await page.goto("/pro/30min");
await selectFirstAvailableTimeSlotNextMonth(page);
await page.fill('[name="name"]', "John Doe");
await page.fill('[name="email"]', "[email protected]");
await page.fill('[name="notes"]', "Test notes");
await page.click('[data-testid="back"]');
await selectFirstAvailableTimeSlotNextMonth(page);
await expect(page.locator('[name="name"]')).toHaveValue("John Doe");
await expect(page.locator('[name="email"]')).toHaveValue("[email protected]");
await expect(page.locator('[name="notes"]')).toHaveValue("Test notes");
});
test("logged out", async ({ page, users }) => {
await page.goto("/pro/30min");