Skip to content

Commit

Permalink
lint:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RODO94 committed Dec 17, 2024
1 parent 14a07bd commit ab34018
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 49 deletions.
23 changes: 13 additions & 10 deletions e2e/tests/ui-driven/src/create-flow-with-geospatial.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ import {
mockPropertyTypeOptions,
mockTitleBoundaryGeoJson,
} from "./mocks/geospatialMocks";
import { setupOSMapsStyles, setupOSMapsVectorTiles } from "./mocks/osMapsResponse";
import {
setupOSMapsStyles,
setupOSMapsVectorTiles,
} from "./mocks/osMapsResponse";

test.describe("Flow creation, publish and preview", () => {
let context: TestContext = {
Expand Down Expand Up @@ -127,8 +130,8 @@ test.describe("Flow creation, publish and preview", () => {
`/${context.team.slug}/${serviceProps.slug}/published?analytics=false`,
);

setupOSMapsStyles(page)
setupOSMapsVectorTiles(page)
setupOSMapsStyles(page);
setupOSMapsVectorTiles(page);

await expect(
page.locator("h1", { hasText: "Find the property" }),
Expand Down Expand Up @@ -183,17 +186,17 @@ test.describe("Flow creation, publish and preview", () => {
const drawBoundaryTitle = page.getByRole("heading", {
name: "Confirm your location plan",
});
await expect(
drawBoundaryTitle,
).toBeVisible();
await expect(drawBoundaryTitle).toBeVisible();

await checkGeoJsonContent(page, "drawgeojsondata", mockTitleBoundaryGeoJson);
await checkGeoJsonContent(
page,
"drawgeojsondata",
mockTitleBoundaryGeoJson,
);

const area = "The property boundary you have drawn is 490.37";

await expect(
page.getByText(area),
).toBeVisible();
await expect(page.getByText(area)).toBeVisible();

// navigate to upload file page and back
await checkUploadFileAltRoute(page);
Expand Down
4 changes: 2 additions & 2 deletions e2e/tests/ui-driven/src/helpers/geospatialChecks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ export const checkUploadFileAltRoute = async (page: Page) => {
"A button for uploading files is visible",
).toBeVisible();

await page.getByTestId('continue-button').click()
await page.getByTestId("continue-button").click();

await page.getByTestId('error-message-upload-location-plan').isVisible()
await page.getByTestId("error-message-upload-location-plan").isVisible();

const useMapButton = page.getByTestId("use-map-button");

Expand Down
21 changes: 12 additions & 9 deletions e2e/tests/ui-driven/src/mocks/geospatialMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,21 @@ export const mockPropertyTypeOptions: OptionWithDataValues[] = [

export const mockTitleBoundaryGeoJson: Feature = {
type: "Feature",
geometry: { type: "MultiPolygon", coordinates: [
[
geometry: {
type: "MultiPolygon",
coordinates: [
[
[-0.633498, 51.605485],
[-0.633455, 51.605606],
[-0.633788, 51.605643],
[-0.634429, 51.605799],
[-0.634429, 51.605767],
[-0.633498, 51.605485],
[
[-0.633498, 51.605485],
[-0.633455, 51.605606],
[-0.633788, 51.605643],
[-0.634429, 51.605799],
[-0.634429, 51.605767],
[-0.633498, 51.605485],
],
],
],
]},
},
properties: {
"entry-date": "2024-05-06",
"start-date": "2010-05-12",
Expand Down
36 changes: 19 additions & 17 deletions e2e/tests/ui-driven/src/mocks/osMapsMockData.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
export const osMapsStylesResponse = {
version: 8,
sprite: "https://api.os.uk/maps/vector/v1/vts/resources/sprites/sprite?key=YOUR_KEY&srs=3857",
glyphs: "https://api.os.uk/maps/vector/v1/vts/resources/fonts/{fontstack}/{range}.pbf?key=YOUR_KEY&srs=3857",
sources: {
esri: {
type: "vector",
url: "https://api.os.uk/maps/vector/v1/vts?key=YOUR_KEY&srs=3857"
}
version: 8,
sprite:
"https://api.os.uk/maps/vector/v1/vts/resources/sprites/sprite?key=YOUR_KEY&srs=3857",
glyphs:
"https://api.os.uk/maps/vector/v1/vts/resources/fonts/{fontstack}/{range}.pbf?key=YOUR_KEY&srs=3857",
sources: {
esri: {
type: "vector",
url: "https://api.os.uk/maps/vector/v1/vts?key=YOUR_KEY&srs=3857",
},
layers: [
{
id: "background",
type: "background",
paint: {
"background-color": "#0437F2"
}
},
layers: [
{
id: "background",
type: "background",
paint: {
"background-color": "#0437F2",
},
]
};
},
],
};
22 changes: 11 additions & 11 deletions e2e/tests/ui-driven/src/mocks/osMapsResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export async function setupOSMapsStyles(page: Page) {
});
}

export async function setupOSMapsVectorTiles(page: Page){
const ordnanceSurveyVectorTiles = new RegExp(
/\/proxy\/ordnance-survey\/maps\/vector\/v1\/vts\/tile/,
)
export async function setupOSMapsVectorTiles(page: Page) {
const ordnanceSurveyVectorTiles = new RegExp(
/\/proxy\/ordnance-survey\/maps\/vector\/v1\/vts\/tile/,
);

await page.route(ordnanceSurveyVectorTiles, async (route) => {
await route.fulfill({
status: 200,
body: Buffer.from([]),
});
});
}
await page.route(ordnanceSurveyVectorTiles, async (route) => {
await route.fulfill({
status: 200,
body: Buffer.from([]),
});
});
}

0 comments on commit ab34018

Please sign in to comment.