Smal
This commit is contained in:
parent
d34478e13c
commit
1934a38677
5 changed files with 66 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue