From 45c07aa8877d1bc694f52da17d597cf0ebae476b Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Fri, 14 Jul 2023 14:33:17 +0100 Subject: [PATCH] Fix tests --- src/lib/sidebar/Instructions.svelte | 7 +++---- tests/modes.spec.ts | 18 +++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/lib/sidebar/Instructions.svelte b/src/lib/sidebar/Instructions.svelte index 7e8e313e8..cf4c321ea 100644 --- a/src/lib/sidebar/Instructions.svelte +++ b/src/lib/sidebar/Instructions.svelte @@ -12,12 +12,11 @@

Drawing {noun} on the map

- Use the tools on right to sketch new {noun} on the map. Each tool has - instructions that appear when you click on its icon. + Use the tools on right to sketch new {noun} on the map. Each tool has instructions + that appear when you click on its icon.

- Modify existing {noun} on the map using Edit geometry and clicking - something. + Modify existing {noun} on the map using Edit geometry and clicking something.

Filling out data

diff --git a/tests/modes.spec.ts b/tests/modes.spec.ts index 85331ec2e..0dc2e0278 100644 --- a/tests/modes.spec.ts +++ b/tests/modes.spec.ts @@ -40,7 +40,7 @@ test("creating a new point opens a form", async () => { await clickMap(page, 500, 500); await page.getByRole("button", { name: "1) Untitled point" }).isVisible(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); }); test("creating a new freehand polygon opens a form", async () => { @@ -51,7 +51,7 @@ test("creating a new freehand polygon opens a form", async () => { await page.getByRole("button", { name: "Finish" }).click(); await page.getByRole("button", { name: "1) Untitled area" }).isVisible(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); }); test("creating a new freehand polygon and switching modes doesn't lose changes", async () => { @@ -64,7 +64,7 @@ test("creating a new freehand polygon and switching modes doesn't lose changes", await page.getByRole("button", { name: "New point" }).click(); await page.getByRole("button", { name: "1) Untitled area" }).click(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); }); test("creating a new freehand polygon and canceling doesn't save anything", async () => { @@ -87,7 +87,7 @@ test("creating a new snapped polygon opens a form", async () => { await page.getByRole("button", { name: "Finish" }).click(); await page.getByRole("button", { name: "1) Untitled area" }).isVisible(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); }); test("creating a new route opens a form, and auto-fill sets its name", async () => { @@ -97,7 +97,7 @@ test("creating a new route opens a form, and auto-fill sets its name", async () await page.getByRole("button", { name: "Finish" }).click(); await page.getByRole("button", { name: "1) Untitled route" }).isVisible(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); // This button only works after RouteInfo is loaded. And note because the // button is located inside a label, getByRole doesn't seem to work. @@ -112,21 +112,21 @@ test("creating a new route opens a form, and auto-fill sets its name", async () test("editing geometry of a polygon works", async () => { // Create a polygon await page.getByRole("button", { name: "New polygon (snapped)" }).click(); - await clickMap(page, 241, 579); + await clickMap(page, 241, 509); await clickMap(page, 235, 431); await clickMap(page, 465, 459); await page.getByRole("button", { name: "Finish" }).click(); await page.getByRole("button", { name: "1) Untitled area" }).isVisible(); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); // Click off the polygon to close the form await clickMap(page, 284, 284); // Make sure the form is closed - await expect(page.getByLabel("Description:")).not.toBeVisible(); + await expect(page.getByLabel("Description")).not.toBeVisible(); // Click the polygon to open the form await clickMap(page, 312, 501); - await page.getByLabel("Description:").click(); + await page.getByLabel("Description").click(); // Edit geometry, and click the polygon again await page.getByRole("button", { name: "Edit geometry" }).click();