mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-23 07:26:30 +00:00
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:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user