mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
test(places): the saved place forms send no tags or notes
The desktop dialog and the phone sheet tests still expected label_ids and notes in the edit form's patch, which the form no longer sends: the tags card and the notes tab write those.
This commit is contained in:
@@ -343,14 +343,11 @@ describe('CollectionPlaceDetail', () => {
|
||||
description: 'Great coffee',
|
||||
links: [{ label: undefined, url: 'https://x.com' }],
|
||||
category_id: 2,
|
||||
// The labels are tags now, set in the overview; the form keeps what the place has.
|
||||
label_ids: [1],
|
||||
// Untouched in this case, but the address rides along on every save (#1870).
|
||||
address: 'Somewhere',
|
||||
lat: 52.5,
|
||||
lng: 13.4,
|
||||
// No notes on this place, and none written (#3168).
|
||||
notes: null,
|
||||
// Tags and notes are written by their own tabs, so the form leaves them alone.
|
||||
});
|
||||
// Back in read mode.
|
||||
expect(await screen.findByRole('button', { name: 'Edit' })).toBeInTheDocument();
|
||||
|
||||
@@ -194,7 +194,7 @@ describe('MCollPlaceSheet', () => {
|
||||
expect(screen.getByDisplayValue('2-6-15 Minami-Aoyama')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-MOB-CPLSH-013: saving sends the trimmed name, the labels as they are, category and normalised links', async () => {
|
||||
it('FE-MOB-CPLSH-013: saving sends the trimmed name, category and normalised links, never the tags or notes', async () => {
|
||||
const { onSave } = setup()
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Edit' }))
|
||||
fireEvent.change(screen.getByDisplayValue('Narisawa'), { target: { value: ' Narisawa Tokyo ' } })
|
||||
@@ -210,10 +210,8 @@ describe('MCollPlaceSheet', () => {
|
||||
{ label: 'Menu', url: 'https://narisawa.example/menu' },
|
||||
{ label: undefined, url: 'https://booking.example/y' },
|
||||
],
|
||||
// Tags and notes are written by their own tabs, so the form leaves them alone.
|
||||
category_id: 3,
|
||||
label_ids: [11],
|
||||
// No notes on this place, and none written (#3168).
|
||||
notes: null,
|
||||
}))
|
||||
// Back to the read view.
|
||||
await waitFor(() => expect(screen.getByRole('button', { name: 'Edit' })).toBeInTheDocument())
|
||||
|
||||
Reference in New Issue
Block a user