Skip to content

Commit

Permalink
Use markers for point tool, updating tests. #536
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Nov 5, 2024
1 parent 517eace commit de85ec8
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/edits.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/errors.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
4 changes: 2 additions & 2 deletions tests/modes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
Expand Down
4 changes: 1 addition & 3 deletions tests/pipeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {
checkPageLoaded,
clearExistingInterventions,
getLocalStorage,
clickMap,
} from "./shared.js";

let page: Page;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions tests/savefiles.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit de85ec8

Please sign in to comment.