fix(mobile,map): long toasts wrap and http selfhosts get the right geolocation message (#2095)

The phone toast was a single truncated pill, which cut the denied message exactly before the settings hint it exists for; long messages wrap up to four lines now. An insecure context is reported as its own error instead of masquerading as a blocked device permission.
This commit is contained in:
Maurice
2026-09-02 19:00:35 +02:00
committed by Maurice
parent e1af2049f9
commit 088eef6c6b
6 changed files with 129 additions and 9 deletions
@@ -1,4 +1,4 @@
// FE-MAP-LOCBTN-001 to FE-MAP-LOCBTN-004
// FE-MAP-LOCBTN-001 to FE-MAP-LOCBTN-005
import { render } from '@testing-library/react';
import LocationButton from './LocationButton';
import type { GeoWatchErrorCode } from '../../hooks/useGeolocation';
@@ -66,4 +66,11 @@ describe('LocationButton', () => {
expect(addToast).toHaveBeenCalledTimes(2);
expect(addToast).toHaveBeenLastCalledWith('map.location.timeout', 'error', 6000);
});
it('FE-MAP-LOCBTN-005: an insecure origin gets the HTTPS hint, not the permission one', () => {
const { getByRole } = render(button('insecure-context', 'Only secure origins are allowed'));
expect(addToast).toHaveBeenCalledWith('journey.editor.locationInsecureContext', 'error', 6000);
expect(getByRole('button').getAttribute('title')).toBe('journey.editor.locationInsecureContext');
});
});