Skip to content

Commit

Permalink
fix remaining failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter York committed Dec 4, 2024
1 parent c1f1b45 commit 326b75d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tests/edits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ test("edit an area, then cancel", async ({ page }) => {
await page.getByRole("link", { name: "Untitled area" }).click();
await clickMap(page, 430, 530);
// This button indicates the mode is working
await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
await expect(page.getByRole("button", { name: "Cancel" }).first()).toBeVisible();

await page.keyboard.down("Escape");
await expectListMode(page);
Expand All @@ -36,7 +36,7 @@ test("edit a route, then cancel", async ({ page }) => {
.click();
await clickMap(page, 442, 492);
// This button indicates the mode is working
await expect(page.getByRole("button", { name: "Cancel" })).toBeVisible();
await expect(page.getByRole("button", { name: "Cancel" }).first()).toBeVisible();

await page.keyboard.down("Escape");
await expectListMode(page);
Expand Down
4 changes: 2 additions & 2 deletions tests/pipeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ test("file without new budget/timing forms can be edited by loading", async ({
await page.getByRole("button", { name: "multiply by 1 million" }).click();
await page.getByText("Is the construction fully funded?").check();
await page.getByText("CRSTS").check();
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

// Check the data in local storage
let json = await getLocalStorage(
Expand Down Expand Up @@ -140,7 +140,7 @@ test("new feature has pipeline forms", async ({ page }) => {
await clickMap(page, 500, 500);
// Make sure pipeline fields like Accuracy show up immediately
await page.getByLabel("High").check();
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

// Check the data in local storage
let json = await getLocalStorage(page, `sketch/LAD_Adur/${filename}`);
Expand Down
4 changes: 2 additions & 2 deletions tests/quota.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("user can resolve running out of quota", async ({ page }) => {
await page.getByRole("button", { name: "New route" }).click();
await clickMap(page, 500, 500);
await clickMap(page, 400, 500);
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

// Resolve the problem
await expect(page).toHaveURL(/.*local_storage.html/);
Expand All @@ -29,7 +29,7 @@ test("user can resolve running out of quota", async ({ page }) => {
await page.getByRole("button", { name: "New route" }).click();
await clickMap(page, 500, 500);
await clickMap(page, 400, 500);
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();
await page
.getByRole("link", { name: "Route from ??? and Beach Green to ???" })
.click();
Expand Down
6 changes: 3 additions & 3 deletions tests/savefiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ test("a saved file is loaded when the URL stays the same", async ({ page }) => {
y: 500,
},
});
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

await page.reload();

Expand All @@ -128,7 +128,7 @@ test("loading a file produced by another tool shows fixable errors", async ({
await page.locator('input[type="text"]').fill("Square area");
await expect(page.getByText("No intervention type")).toBeVisible();
await page.getByText("Area", { exact: true }).click();
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();
await expect(
page.getByText("There's a problem with one intervention below"),
).toBeVisible();
Expand Down Expand Up @@ -189,7 +189,7 @@ test("download a file and then reimport it", async ({ page }) => {
await page.getByRole("button", { name: "New point" }).click();
await page.getByLabel("Name").fill("Pointless");
await clickMap(page, 500, 500);
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

// Download it, and check the filename
let downloadPromise = page.waitForEvent("download");
Expand Down
2 changes: 1 addition & 1 deletion tests/v2.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ test("v2 forms work", async ({ page }) => {
// Edit the point and make sure the forms are still there
await page.getByRole("link", { name: "Untitled point" }).click();
await page.getByLabel("Improvements to something already existing").check();
await page.getByRole("button", { name: "Finish" }).click();
await page.getByRole("button", { name: "Finish" }).first().click();

// Check the edit
await page.getByRole("link", { name: "Untitled point" }).click();
Expand Down

0 comments on commit 326b75d

Please sign in to comment.