Fix CI
All checks were successful
Build and publish Docker image / build-and-push (push) Successful in 4m15s
CI / Check (push) Successful in 5m49s

This commit is contained in:
Andras Schmelczer 2026-06-06 20:37:54 +01:00
parent 719dd27600
commit b4d66a28c1
5 changed files with 14 additions and 15 deletions

View file

@ -169,7 +169,7 @@ describe('LocationSearch', () => {
});
});
it('waits for nearest postcode selection before flying to a place result', async () => {
it('flies to a place result immediately and resolves its nearest postcode for the side panel', async () => {
window.localStorage.setItem(
RECENT_SEARCHES_STORAGE_KEY,
JSON.stringify([
@ -201,7 +201,11 @@ describe('LocationSearch', () => {
fireEvent.focus(input);
fireEvent.mouseDown(await screen.findByRole('button', { name: 'E14' }));
expect(onFlyTo).not.toHaveBeenCalled();
// The camera moves straight away from the result's own coordinates, without
// waiting on the nearest-postcode lookup (which only feeds the side panel).
expect(onFlyTo).toHaveBeenCalledWith(51.505, -0.01, 16);
expect(onLocationSearched).not.toHaveBeenCalled();
nearestLookup.resolve(
jsonResponse({
postcode: 'E14 2DG',
@ -223,9 +227,9 @@ describe('LocationSearch', () => {
markerLatitude: 51.505,
markerLongitude: -0.01,
});
expect(onFlyTo).toHaveBeenCalledWith(51.505, -0.01, 16);
expect(onLocationSearched.mock.invocationCallOrder[0]).toBeLessThan(
onFlyTo.mock.invocationCallOrder[0]
expect(onFlyTo).toHaveBeenCalledTimes(1);
expect(onFlyTo.mock.invocationCallOrder[0]).toBeLessThan(
onLocationSearched.mock.invocationCallOrder[0]
);
});