Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Dec 9, 2024
1 parent e0772d5 commit c5a5d7c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 16 deletions.
39 changes: 25 additions & 14 deletions e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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
});
Expand Down
7 changes: 5 additions & 2 deletions e2e/tests/ui-driven/src/helpers/geospatialChecks.ts
Original file line number Diff line number Diff line change
@@ -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");

Expand All @@ -10,4 +14,3 @@ export const checkGeoJsonContent = async (page: Page, attribute:"geojsondata" |

expect(JSON.parse(geojsonData!)).toEqual(geoJson);
};

0 comments on commit c5a5d7c

Please sign in to comment.