From de85ec8352e875a5ae7b28857bc1fa153436b1f9 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Tue, 5 Nov 2024 14:43:34 +0000 Subject: [PATCH] Use markers for point tool, updating tests. #536 --- package-lock.json | 2 +- tests/edits.spec.ts | 1 + tests/errors.spec.ts | 1 + tests/modes.spec.ts | 4 ++-- tests/pipeline.spec.ts | 4 +--- tests/savefiles.spec.ts | 1 + 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 45f099f0..54d8288f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3794,7 +3794,7 @@ }, "node_modules/scheme-sketcher-lib": { "version": "0.0.1", - "resolved": "git+ssh://git@github.com/acteng/scheme-sketcher-lib.git#764a0da3e37e17ef69c38b7387767b415bb8b883", + "resolved": "git+ssh://git@github.com/acteng/scheme-sketcher-lib.git#d57a27c702af4dcbb5abea52c40a26225e0b98a4", "dependencies": { "@maptiler/geocoding-control": "1.2.3", "@turf/mask": "^7.0.0", diff --git a/tests/edits.spec.ts b/tests/edits.spec.ts index 76818bab..c34b68c0 100644 --- a/tests/edits.spec.ts +++ b/tests/edits.spec.ts @@ -75,6 +75,7 @@ test.skip("the viewport changes only once when opening a form", async () => { // Create a point, and make sure the viewport hasn't changed await page.getByRole("button", { name: "New point" }).click(); await clickMap(page, 500, 500); + await page.getByRole("button", { name: "Finish" }).click(); await expect.soft(new URL(page.url()).hash).toEqual(defaultViewport); // Open the form from the sidebar. The viewport should change diff --git a/tests/errors.spec.ts b/tests/errors.spec.ts index d8806809..650bc425 100644 --- a/tests/errors.spec.ts +++ b/tests/errors.spec.ts @@ -18,6 +18,7 @@ test("other tools work when route tool doesn't load", 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 expect(page.getByRole("link", { name: "Pointless" })).toBeVisible(); }); diff --git a/tests/modes.spec.ts b/tests/modes.spec.ts index 8c65488c..6fef7139 100644 --- a/tests/modes.spec.ts +++ b/tests/modes.spec.ts @@ -17,10 +17,10 @@ test.beforeEach(async () => { test("creating a new point opens a form", async () => { await page.getByRole("button", { name: "New point" }).click(); + await clickMap(page, 500, 500); await page.getByLabel("Name").fill("Point name"); await page.getByLabel("Description").click(); - - await clickMap(page, 500, 500); + await page.getByRole("button", { name: "Finish" }).click(); await page.getByRole("link", { name: "Point name" }).click(); }); diff --git a/tests/pipeline.spec.ts b/tests/pipeline.spec.ts index 0863b4d4..0edb8256 100644 --- a/tests/pipeline.spec.ts +++ b/tests/pipeline.spec.ts @@ -3,7 +3,6 @@ import { checkPageLoaded, clearExistingInterventions, getLocalStorage, - clickMap, } from "./shared.js"; let page: Page; @@ -111,8 +110,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(); - // TODO Editing points is special; there's no finish button right now. Click the map instead to confirm. - await clickMap(page, 400, 600); + await page.getByRole("button", { name: "Finish" }).click(); // Check the data in local storage let json = await getLocalStorage(page, "LAD_Adur_pipeline"); diff --git a/tests/savefiles.spec.ts b/tests/savefiles.spec.ts index 4d15abb3..eb8cb032 100644 --- a/tests/savefiles.spec.ts +++ b/tests/savefiles.spec.ts @@ -105,6 +105,7 @@ test("the previous file from local storage is loaded by default", async () => { y: 500, }, }); + await page.getByRole("button", { name: "Finish" }).click(); await page.reload();