mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
fix(mobile): harden back gestures and repair CI regressions
Reflect the drag position in the sheet scrim and match back gestures to the reading direction. Keep Escape on the top overlay and update failing tests for the redesigned forms, navigation, and offline preparation. Remove dead exports and lower obsolete lint counts.
This commit is contained in:
@@ -440,9 +440,9 @@ describe('DawarichAcceptDialog', () => {
|
||||
phone.value = true
|
||||
const { onConfirm } = open({ trips: TRIPS, daysForTrip })
|
||||
|
||||
expect(screen.getByRole('dialog', { name: 'Add this stay as a place' })).toBeInTheDocument()
|
||||
// The desktop modal's own heading is the tell that the wrong shell rendered.
|
||||
expect(screen.queryByRole('heading', { name: 'Add this stay as a place' })).toBeNull()
|
||||
const sheet = screen.getByRole('dialog', { name: 'Add this stay as a place' })
|
||||
expect(sheet).toHaveAttribute('data-m-sheet', 'open')
|
||||
expect(screen.getByRole('heading', { name: 'Add this stay as a place' })).toBeInTheDocument()
|
||||
|
||||
fireEvent.change(screen.getByLabelText('Name'), { target: { value: 'Reichard' } })
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Add place' }))
|
||||
|
||||
@@ -52,7 +52,7 @@ export default function ContributorInviteDialog({ journeyId, existingUserIds, on
|
||||
const toast = useToast()
|
||||
|
||||
useEffect(() => {
|
||||
authApi.listUsers().then(d => setUsers(d.users || [])).catch(() => {}).finally(() => setLoading(false))
|
||||
authApi.listUsers().then(d => setUsers(d.users || [])).catch(() => setUsers([])).finally(() => setLoading(false))
|
||||
}, [])
|
||||
|
||||
// Captured and stopped on the desktop: the dialog is usually opened from the
|
||||
|
||||
@@ -28,9 +28,9 @@ describe('splitMobileNav', () => {
|
||||
it('docks the top two enabled defaults when there is no config', () => {
|
||||
for (const cfg of [undefined, { bar: [], more: [] }]) {
|
||||
const s = splitMobileNav(items, cfg)
|
||||
expect(ids(s.bar)).toEqual(['dashboard', 'vacay', 'journey'])
|
||||
expect(ids(s.bar)).toEqual(['dashboard', 'collections', 'journey'])
|
||||
// Atlas is still reachable, one tap further under More.
|
||||
expect(ids(s.more)).toEqual(['atlas', 'collections'])
|
||||
expect(ids(s.more)).toEqual(['vacay', 'atlas'])
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('BookingImportModal', () => {
|
||||
const upload = vi.fn(() => HttpResponse.json({ jobId: 'mobile-pdf' }));
|
||||
server.use(http.post('/api/trips/4/reservations/import/booking/async', upload));
|
||||
render(<MBookingImportSheet {...defaultProps} kind="bookings" onClose={onClose} />);
|
||||
expect(screen.getByRole('dialog', { name: 'Import booking confirmations' })).toBeInTheDocument();
|
||||
expect(screen.getByRole('dialog', { name: 'Import from file' })).toBeInTheDocument();
|
||||
await userEvent.upload(fileInput(), [pdf, eml()]);
|
||||
await userEvent.click(screen.getByRole('button', { name: 'Remove: booking.eml' }));
|
||||
const submit = screen.getByRole('button', { name: 'Import' });
|
||||
|
||||
@@ -38,8 +38,8 @@ describe('useMobileNavEditor', () => {
|
||||
it('FE-COMP-NAVEDITOR-001: an empty value falls back to the built-in dock split', () => {
|
||||
const { result } = setup({ bar: [], more: [] });
|
||||
|
||||
expect(ids(result.current.barItems)).toEqual(['vacay', 'journey']);
|
||||
expect(ids(result.current.moreItems)).toEqual(['atlas', 'collections']);
|
||||
expect(ids(result.current.barItems)).toEqual(['collections', 'journey']);
|
||||
expect(ids(result.current.moreItems)).toEqual(['vacay', 'atlas']);
|
||||
expect(result.current.hasMore).toBe(true);
|
||||
expect(result.current.barFull).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user