-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add E2E Coverage for Property Information (#4025)
- Loading branch information
Showing
8 changed files
with
190 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
"packageManager": "[email protected]", | ||
"devDependencies": { | ||
"@playwright/test": "^1.49.0", | ||
"@types/geojson": "^7946.0.14", | ||
"@types/node": "18.16.1", | ||
"eslint-plugin-playwright": "^0.20.0" | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { expect, Page } from "@playwright/test"; | ||
import { Feature } from "geojson"; | ||
|
||
export const checkGeoJsonContent = async (page: Page, geoJson: Feature) => { | ||
// Wait for the map component to be present | ||
const mapComponent = await page.waitForSelector("my-map"); | ||
|
||
// Get the geojsonData attribute | ||
const geojsonData = await mapComponent.getAttribute("geojsondata"); | ||
|
||
expect(JSON.parse(geojsonData!)).toEqual(geoJson); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { OptionWithDataValues } from "../helpers/types"; | ||
|
||
export const mockPropertyTypeOptions: OptionWithDataValues[] = [ | ||
{ optionText: "Residential", dataValue: "residential" }, | ||
{ optionText: "Commercial", dataValue: "commercial" }, | ||
]; | ||
|
||
import { Feature } from "geojson"; | ||
|
||
export const mockMapGeoJson: Feature = { | ||
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], | ||
], | ||
], | ||
], | ||
}, | ||
type: "Feature", | ||
properties: { | ||
"entry-date": "2024-05-06", | ||
"start-date": "2010-05-12", | ||
"end-date": "", | ||
entity: 12000041468, | ||
name: "", | ||
dataset: "title-boundary", | ||
typology: "geography", | ||
reference: "45211072", | ||
prefix: "title-boundary", | ||
"organisation-entity": "13", | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters