This commit is contained in:
Andras Schmelczer 2026-05-28 21:48:35 +01:00
parent 39ef5c6646
commit c995f12f8b
78 changed files with 4830 additions and 1619 deletions

View file

@ -173,6 +173,30 @@ describe('url-state', () => {
expect(state.overlays).toEqual(new Set(['noise', 'crime-hotspots']));
});
it('round-trips satellite basemap selection', () => {
const params = stateToParams(
null,
{},
[],
new Set(),
'area',
undefined,
undefined,
undefined,
'satellite'
);
expect(params.get('basemap')).toBe('satellite');
window.history.replaceState({}, '', `/?${params.toString()}`);
const state = parseUrlState();
expect(state.basemap).toBe('satellite');
window.history.replaceState({}, '', '/?basemap=unknown');
expect(parseUrlState().basemap).toBe('standard');
});
it('round-trips repeated school filters with dedicated URL params', () => {
const schoolOne = createSchoolFilterKey('primary', 'good', 2, 1);
const schoolTwo = createSchoolFilterKey('secondary', 'outstanding', 5, 2);