-
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: Map and Label Payload Tests (#3698)
- Loading branch information
Showing
3 changed files
with
126 additions
and
31 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
13 changes: 11 additions & 2 deletions
13
editor.planx.uk/src/@planx/components/MapAndLabel/test/mocks/GenericValues.ts
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 |
---|---|---|
@@ -1,6 +1,15 @@ | ||
export const mockTreeData = { | ||
export type TreeData = { | ||
species: string; | ||
work: string; | ||
justification: string; | ||
urgency: "low" | "moderate" | "high" | "urgenct"; | ||
label: string; | ||
}; | ||
|
||
export const mockTreeData: TreeData = { | ||
species: "Larch", | ||
work: "Chopping it down", | ||
justification: "Cause I can", | ||
urgency: "Low", | ||
urgency: "low", | ||
label: "1", | ||
}; |
21 changes: 21 additions & 0 deletions
21
editor.planx.uk/src/@planx/components/MapAndLabel/test/mocks/mockPayload.tsx
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,21 @@ | ||
import { FeatureCollection } from "geojson"; | ||
import { mockTreeData } from "./GenericValues"; | ||
export type MockPayload = { data: { MockFn: FeatureCollection } }; | ||
|
||
export const mockSingleFeaturePayload: MockPayload = { | ||
data: { | ||
MockFn: { | ||
features: [ | ||
{ | ||
geometry: { | ||
coordinates: [-3.685929607119201, 57.15301433687542], | ||
type: "Point", | ||
}, | ||
properties: { mockTreeData }, | ||
type: "Feature", | ||
}, | ||
], | ||
type: "FeatureCollection", | ||
}, | ||
}, | ||
}; |