From c5a5d7c2c4caf50fb8410dfbde2f3fd94bcaef3d Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Tue, 3 Dec 2024 18:44:31 +0000 Subject: [PATCH] lint:fix --- .../src/create-flow-with-geospatial.spec.ts | 39 ++++++++++++------- .../ui-driven/src/helpers/geospatialChecks.ts | 7 +++- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts index 1381cd2e5e..68974ad144 100644 --- a/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts +++ b/e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts @@ -128,7 +128,7 @@ test.describe("Flow creation, publish and preview", () => { ).toBeVisible(); // Check map component has geoJson content - await checkGeoJsonContent(page, "geojsondata" ,mockMapGeoJson); + await checkGeoJsonContent(page, "geojsondata", mockMapGeoJson); // Check property info is being shown await expect(page.getByText("Test Street, Testville")).toBeVisible(); @@ -167,26 +167,37 @@ test.describe("Flow creation, publish and preview", () => { ).toBeVisible(); await clickContinue({ page }); - const drawBoundaryTitle = page.getByRole('heading', { name: 'Confirm your location plan' }) - await expect(drawBoundaryTitle).toBeVisible() + const drawBoundaryTitle = page.getByRole("heading", { + name: "Confirm your location plan", + }); + await expect(drawBoundaryTitle).toBeVisible(); - const uploadButton = page.getByTestId('upload-file-button') - - await expect(uploadButton).toBeVisible() - await expect(page.getByText("490.37"),"Checking for area text").toBeVisible() + const uploadButton = page.getByTestId("upload-file-button"); - await checkGeoJsonContent(page, "drawgeojsondata" ,mockMapGeoJson); + await expect(uploadButton).toBeVisible(); + await expect( + page.getByText("490.37"), + "Checking for area text", + ).toBeVisible(); - await uploadButton.click() - await expect(page.getByRole('heading', { name: 'Upload a location plan' }), "Ensure we can navigate to upload location plan").toBeVisible() + await checkGeoJsonContent(page, "drawgeojsondata", mockMapGeoJson); + + await uploadButton.click(); + await expect( + page.getByRole("heading", { name: "Upload a location plan" }), + "Ensure we can navigate to upload location plan", + ).toBeVisible(); // const uploadFileButton = page.getByRole('button', { name: 'Drop file here or choose' }) - const useMapButton = page.getByTestId('use-map-button') + const useMapButton = page.getByTestId("use-map-button"); + + await useMapButton.click(); - await useMapButton.click() + await expect( + drawBoundaryTitle, + "Ensure we've navigated back to the map component", + ).toBeVisible(); - await expect(drawBoundaryTitle, "Ensure we've navigated back to the map component").toBeVisible() - // TODO: answer uploadAndLabel // TODO: answerPropertyInfo, answerPlanningConstraints }); diff --git a/e2e/tests/ui-driven/src/helpers/geospatialChecks.ts b/e2e/tests/ui-driven/src/helpers/geospatialChecks.ts index e242e2007a..ed5f5b3f0a 100644 --- a/e2e/tests/ui-driven/src/helpers/geospatialChecks.ts +++ b/e2e/tests/ui-driven/src/helpers/geospatialChecks.ts @@ -1,7 +1,11 @@ import { expect, Page } from "@playwright/test"; import { Feature } from "geojson"; -export const checkGeoJsonContent = async (page: Page, attribute:"geojsondata" | "drawgeojsondata", geoJson: Feature) => { +export const checkGeoJsonContent = async ( + page: Page, + attribute: "geojsondata" | "drawgeojsondata", + geoJson: Feature, +) => { // Wait for the map component to be present const mapComponent = await page.waitForSelector("my-map"); @@ -10,4 +14,3 @@ export const checkGeoJsonContent = async (page: Page, attribute:"geojsondata" | expect(JSON.parse(geojsonData!)).toEqual(geoJson); }; -