This commit is contained in:
Andras Schmelczer 2026-06-18 08:00:39 +01:00
parent d34478e13c
commit 1934a38677
5 changed files with 66 additions and 9 deletions

View file

@ -196,6 +196,32 @@ describe('url-state', () => {
expect(state.overlays).toEqual(new Set(['noise', 'crime-hotspots']));
});
it('enables crime + trees overlays by default on a fresh visit', () => {
const state = parseUrlState();
expect(state.overlays).toEqual(new Set(['crime-hotspots', 'trees-outside-woodlands']));
});
it('round-trips an explicit "all overlays off" via the __none sentinel', () => {
const params = stateToParams(
null,
{},
[],
new Set(),
'area',
undefined,
undefined,
new Set()
);
expect(params.getAll('overlay')).toEqual(['__none']);
window.history.replaceState({}, '', `/?${params.toString()}`);
const state = parseUrlState();
expect(state.overlays).toEqual(new Set());
});
it('round-trips satellite basemap selection', () => {
const params = stateToParams(
null,