-
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.
address comments from review refine osMapsMocks rename OSMapMocks
- Loading branch information
Showing
4 changed files
with
69 additions
and
22 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
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,20 @@ | ||
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" | ||
} | ||
}, | ||
layers: [ | ||
{ | ||
id: "background", | ||
type: "background", | ||
paint: { | ||
"background-color": "#0437F2" | ||
} | ||
}, | ||
] | ||
}; |
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,27 @@ | ||
import { Page } from "@playwright/test"; | ||
import { osMapsStylesResponse } from "./osMapsMockData"; | ||
|
||
export async function setupOSMapsStyles(page: Page) { | ||
const ordnanceSurveyMapsStyles = new RegExp( | ||
/\/proxy\/ordnance-survey\/maps\/vector\/v1\/vts\/resources\/styles.*/, | ||
); | ||
await page.route(ordnanceSurveyMapsStyles, async (route) => { | ||
await route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(osMapsStylesResponse), | ||
}); | ||
}); | ||
} | ||
|
||
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([]), | ||
}); | ||
}); | ||
} |