fix(mobile): Studio's inspector stays docked on an iPad in landscape, the linked journal's buttons sit beside its switch, and the iOS app draws Leaflet's basemap as raster tiles

This commit is contained in:
Maurice
2026-11-08 13:12:53 +01:00
parent 26dc88181d
commit 4d550112a1
6 changed files with 42 additions and 19 deletions
@@ -39,6 +39,8 @@ vi.mock('react-leaflet', () => ({
// jsdom has no WebGL, so without this every case below would take the raster
// branch. The suite is about the GL wiring; the raster branch has its own cases.
vi.mock('../../utils/webgl', () => ({ hasWebGL: vi.fn(() => true), resetWebGLProbe: vi.fn() }))
const platform = vi.hoisted(() => ({ ios: false }))
vi.mock('../../native/platform', () => ({ isNativeIos: () => platform.ios, isNativeApp: () => platform.ios }))
vi.mock('./engines/maplibre', () => ({ default: { __engine: 'maplibre' } }))
vi.mock('@maplibre/maplibre-gl-leaflet', () => {
const maplibreGL = vi.fn(() => {
@@ -153,6 +155,17 @@ describe('VectorBasemap', () => {
warn.mockRestore()
})
it('FE-COMP-VECBM-021: in the iOS app the basemap is raster tiles, and no GL layer is built', async () => {
platform.ios = true
try {
const { findByTestId } = render(<VectorBasemap style={OFM_POSITRON} />)
expect(await findByTestId('raster-basemap')).toBeInTheDocument()
expect(maplibreGL).not.toHaveBeenCalled()
} finally {
platform.ios = false
}
})
it('FE-COMP-VECBM-004: takes the layer off the map on unmount', async () => {
const { unmount } = render(<VectorBasemap style={OFM_POSITRON} />)
await waitFor(() => expect(maplibreGL).toHaveBeenCalledTimes(1))