has issues

This commit is contained in:
Andras Schmelczer 2026-05-25 13:20:17 +01:00
parent 2e112d7398
commit c645b0f1d4
96 changed files with 2147083 additions and 5787 deletions

View file

@ -48,6 +48,8 @@ describe('url-state', () => {
label: 'Kings Cross',
timeRange: [0, 30],
useBest: true,
noChange: false,
noBuses: false,
},
]);
});
@ -115,6 +117,8 @@ describe('url-state', () => {
label: 'Bank',
timeRange: [10, 45],
useBest: false,
noChange: false,
noBuses: false,
},
]);
@ -149,6 +153,26 @@ describe('url-state', () => {
expect(state.poiCategories).toEqual(new Set());
});
it('round-trips overlay selections', () => {
const params = stateToParams(
null,
{},
[],
new Set(),
'area',
undefined,
undefined,
new Set(['noise', 'crime-hotspots'])
);
expect(params.getAll('overlay')).toEqual(['noise', 'crime-hotspots']);
window.history.replaceState({}, '', `/?${params.toString()}&overlay=unknown`);
const state = parseUrlState();
expect(state.overlays).toEqual(new Set(['noise', 'crime-hotspots']));
});
it('round-trips repeated school filters with dedicated URL params', () => {
const schoolOne = createSchoolFilterKey('primary', 'good', 2, 1);
const schoolTwo = createSchoolFilterKey('secondary', 'outstanding', 5, 2);