mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 02:34:21 +00:00
feat(places): say when a place has an address but no coordinates (#2837)
A place saved with a typed address and no search pick, link or map point gets no coordinates, so it never shows on the map, and nothing said why. The place form warns under the address while that is so, and the inspector, the phone's place sheet and both place lists mark such a place. No geocoding on save; the form stays unchanged for a service stop, which explains a missing position itself.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// FE-COMP-PLACES-001 to FE-COMP-PLACES-015 + FE-PLANNER-SIDEBAR-016 to 067
|
||||
// FE-COMP-PLACES-001 to FE-COMP-PLACES-015 + FE-PLANNER-SIDEBAR-016 to 068
|
||||
import { render, screen, fireEvent, waitFor, act, within } from '../../../tests/helpers/render';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
@@ -1168,3 +1168,16 @@ describe('Category filter: places without a category', () => {
|
||||
expect(screen.queryByRole('button', { name: 'No Category' })).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
describe('Places without coordinates', () => {
|
||||
it('FE-PLANNER-SIDEBAR-068: a typed address without coordinates is marked as not on the map (#2837)', () => {
|
||||
const typed = buildPlace({ name: 'Typed Cafe', address: 'Rue de Rivoli 1, Paris', lat: null, lng: null });
|
||||
const picked = buildPlace({ name: 'Picked Cafe', address: 'Rue de Rivoli 2, Paris' });
|
||||
const note = buildPlace({ name: 'Loose Idea', address: null, lat: null, lng: null });
|
||||
render(<PlacesSidebar {...defaultProps} places={[typed, picked, note]} />);
|
||||
|
||||
const marks = screen.getAllByRole('img', { name: 'No coordinates, so not on the map' });
|
||||
expect(marks).toHaveLength(1);
|
||||
expect(marks[0].closest('[data-place-id]')).toHaveAttribute('data-place-id', String(typed.id));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user