mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-05 18:34:09 +00:00
fix: dev green after the Studio, place picture and tour merges
The ids of long catalogues (fonts, shapes, patterns) read as a checked string in the book tools' schemas, so restore_book_page and the page edit stay under their ceilings. The lightbox takes its reading direction from the language. Baselines follow the removed avatar upload and the lower counts, the doubled NEWER constants and three unused imports go, the locale indexes are sorted, and the place gallery, picture, sheet, inspector weight and paddle tests follow the merged behaviour.
This commit is contained in:
@@ -613,16 +613,19 @@ describe('PlaceDetailsColumn — picture layout', () => {
|
||||
withPhotos(3)
|
||||
const { onPickImage } = renderColumn()
|
||||
|
||||
// Nothing is picked yet, and the line under the grid says so.
|
||||
await screen.findByText('places.image.none')
|
||||
expect(screen.queryByText('Author 0')).not.toBeInTheDocument()
|
||||
// Nothing is picked and there is no own picture to remove, so 'No picture'
|
||||
// stays away and the first photo is credited.
|
||||
await screen.findByText('Author 0')
|
||||
expect(screen.queryByText('places.image.none')).not.toBeInTheDocument()
|
||||
const tiles = screen.getAllByRole('button', { name: /places.details.pickImage/ })
|
||||
fireEvent.mouseEnter(tiles[2])
|
||||
|
||||
expect(screen.getByText('Author 2')).toBeInTheDocument()
|
||||
expect(screen.queryByText('Author 0')).not.toBeInTheDocument()
|
||||
expect(onPickImage).not.toHaveBeenCalled()
|
||||
fireEvent.mouseLeave(tiles[2])
|
||||
expect(screen.queryByText('Author 2')).not.toBeInTheDocument()
|
||||
expect(screen.getByText('Author 0')).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('FE-PDC-037: credits the picture in play, licence included', async () => {
|
||||
|
||||
@@ -43,7 +43,6 @@ import {
|
||||
} from '../shared/DialogShell'
|
||||
import { EditorField, GRID_2, INPUT, LABEL, PANEL, PillSelect, TEXTAREA } from '../shared/dialogParts'
|
||||
import { SoftPill, tintOf } from './planParts'
|
||||
import { WHITE_BUTTON } from './placeDialogParts'
|
||||
import { TimeSection } from './PlaceFormTimeSection'
|
||||
|
||||
// The submit payload mirrors the form, but lat/lng are parsed to numbers and
|
||||
|
||||
@@ -11,7 +11,11 @@ import PlacePhotoGallery from './PlacePhotoGallery';
|
||||
import { __clearEnrichmentCacheForTests } from './placeEnrichment';
|
||||
|
||||
const placeEnrichment = vi.fn();
|
||||
vi.mock('../../api/client', () => ({ mapsApi: { placeEnrichment: (...a: unknown[]) => placeEnrichment(...a) } }));
|
||||
// Partial: the store registry behind resetAllStores needs the real default client.
|
||||
vi.mock('../../api/client', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('../../api/client')>()),
|
||||
mapsApi: { placeEnrichment: (...a: unknown[]) => placeEnrichment(...a) },
|
||||
}));
|
||||
vi.mock('../Journey/VideoPlayerLazy', () => ({ default: () => null }));
|
||||
|
||||
const PLACE = buildPlace({ id: 3, name: 'Tower', lat: 48.85, lng: 2.29, image_url: '/uploads/places/tower.jpg' });
|
||||
|
||||
@@ -13,7 +13,11 @@ import { __clearEnrichmentCacheForTests, readCachedEnrichment, storeEnrichment }
|
||||
import { usePlaceGallery } from './usePlaceGallery';
|
||||
|
||||
const placeEnrichment = vi.fn();
|
||||
vi.mock('../../api/client', () => ({ mapsApi: { placeEnrichment: (...a: unknown[]) => placeEnrichment(...a) } }));
|
||||
// Partial: the store registry behind resetAllStores needs the real default client.
|
||||
vi.mock('../../api/client', async (importOriginal) => ({
|
||||
...(await importOriginal<typeof import('../../api/client')>()),
|
||||
mapsApi: { placeEnrichment: (...a: unknown[]) => placeEnrichment(...a) },
|
||||
}));
|
||||
// One toast for every render, the way the real hook memoises it.
|
||||
const toast = vi.hoisted(() => ({ success: vi.fn(), error: vi.fn(), warning: vi.fn(), info: vi.fn() }));
|
||||
vi.mock('../shared/Toast', () => ({ useToast: () => toast }));
|
||||
|
||||
Reference in New Issue
Block a user