lgtm 2
This commit is contained in:
parent
a8de0a614d
commit
3fa95819e3
30 changed files with 907 additions and 205 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import type { FeatureMeta } from '../types';
|
||||
import { apiUrl, assertOk, buildFilterString, isAbortError } from './api';
|
||||
import { apiUrl, assertOk, buildFilterString, isAbortError, paramsWithLanguage } from './api';
|
||||
import { createSchoolFilterKey } from './school-filter';
|
||||
import { createSpecificCrimeFilterKey } from './crime-filter';
|
||||
import { createElectionVoteShareFilterKey } from './election-filter';
|
||||
|
|
@ -38,6 +38,11 @@ describe('api utilities', () => {
|
|||
expect(isAbortError(regular)).toBe(false);
|
||||
});
|
||||
|
||||
it('adds supported language parameters without overriding explicit languages', () => {
|
||||
expect(paramsWithLanguage('lat=51.5&lon=-0.1', 'fr-FR')).toBe('lat=51.5&lon=-0.1&lang=fr');
|
||||
expect(paramsWithLanguage('lat=51.5&lang=de', 'fr')).toBe('lat=51.5&lang=de');
|
||||
});
|
||||
|
||||
it('serializes numeric, absolute, and enum filters for backend routes', () => {
|
||||
const features: FeatureMeta[] = [
|
||||
{ name: 'Last known price', type: 'numeric', min: 0, max: 1_000_000 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue