Skip to content

Commit

Permalink
fix: added assertion for #location and test after page refresh.
Browse files Browse the repository at this point in the history
  • Loading branch information
petercr committed Nov 17, 2024
1 parent 4699c2b commit 1fad2e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion e2e/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test.describe("Authenticated settings Page", () => {
await page.goto("http://localhost:3000/settings");

// Test to see if input is visible
await page.locator('input[id="location"]').isVisible();
await expect(page.locator('input[id="location"]')).toBeVisible();

// Test to fill if value can be changed
await page.fill('input[id="location"]', "New York");
Expand All @@ -73,5 +73,11 @@ test.describe("Authenticated settings Page", () => {
await expect(page.locator('input[id="location"]')).toHaveValue(
"A fun place to visit.",
);

// Verify persistence after reload
await page.reload();
await expect(page.locator('input[id="location"]')).toHaveValue(
"A fun place to visit.",
);
});
});

0 comments on commit 1fad2e0

Please sign in to comment.