From 8c7fc989dc1ee883a38d9d6979af9565c1916a89 Mon Sep 17 00:00:00 2001 From: Maurice Date: Fri, 23 Oct 2026 22:19:23 +0200 Subject: [PATCH] fix: the merged tour, home and lightbox changes pass their checks The demo gate test allows wanderer as the parity harness does, the open tour store is listed in the store registry, the trip chat card's test reads the dates and not the question's hidden label, the lightbox leaves the rtl baseline, and the tours module is formatted. --- client/scripts/rtl-baseline.json | 1 - .../components/Assistant/cards/home/TripChatBlock.test.tsx | 3 ++- client/tests/helpers/storeRegistry.ts | 1 + server/src/nest/tours/tours.module.ts | 2 +- server/tests/unit/mcp/demo-tool-gate.test.ts | 4 +++- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/scripts/rtl-baseline.json b/client/scripts/rtl-baseline.json index 41c1eace1..cf8f5f91c 100644 --- a/client/scripts/rtl-baseline.json +++ b/client/scripts/rtl-baseline.json @@ -18,7 +18,6 @@ "components/Journey/JourneyMap.tsx": 1, "components/Journey/JourneyMapGL.tsx": 2, "components/Journey/MobileEntryView.tsx": 1, - "components/Journey/PhotoLightbox.tsx": 3, "components/Journey/journeyPhotoLayer.ts": 1, "components/Layout/Navbar.tsx": 1, "components/Layout/OfflineBanner.tsx": 1, diff --git a/client/src/components/Assistant/cards/home/TripChatBlock.test.tsx b/client/src/components/Assistant/cards/home/TripChatBlock.test.tsx index 4b6651098..7333a994e 100644 --- a/client/src/components/Assistant/cards/home/TripChatBlock.test.tsx +++ b/client/src/components/Assistant/cards/home/TripChatBlock.test.tsx @@ -39,7 +39,8 @@ describe('TripChatBlock', () => { expect(screen.getByRole('region', { name: 'Continue in a trip chat' })).toBeInTheDocument(); expect(screen.getByText('Kyoto')).toBeInTheDocument(); expect(screen.getByText('Trip chat')).toBeInTheDocument(); - expect(screen.getByText(/ to /)).toBeInTheDocument(); + // The dates, not the hidden label of the question, which has a "to" of its own. + expect(screen.getByText(/\d to \w/)).toBeInTheDocument(); expect(screen.getByText('Next')).toBeInTheDocument(); expect(screen.getByText('12 places')).toBeInTheDocument(); expect(screen.getByText('What is still missing?')).toBeInTheDocument(); diff --git a/client/tests/helpers/storeRegistry.ts b/client/tests/helpers/storeRegistry.ts index b15187292..f740b6fa1 100644 --- a/client/tests/helpers/storeRegistry.ts +++ b/client/tests/helpers/storeRegistry.ts @@ -59,6 +59,7 @@ export const UNRESET_STORES: Record = { 'its own tests put it back with clear(); it holds one open collection and nothing else reads it', useDocSyncOfferStore: NOT_YET, useHelpStore: NOT_YET, + useOpenTourStore: 'the saved tour open in the Tours tab, set by its stage; the tests that read it set it themselves', usePluginStore: NOT_YET, useRoadtripPreferencesStore: NOT_YET, useSaveToCollectionStore: NOT_YET, diff --git a/server/src/nest/tours/tours.module.ts b/server/src/nest/tours/tours.module.ts index 5661d6303..dca5fdb46 100644 --- a/server/src/nest/tours/tours.module.ts +++ b/server/src/nest/tours/tours.module.ts @@ -77,9 +77,9 @@ import { TourPoiSearchService } from './tour-poi-search.service'; import { TourSkiController } from './tour-ski.controller'; import { TourSkiService } from './tour-ski.service'; import { TourSportWritesMcp } from './tour-sport-writes.mcp'; -import { TourTrailDetailsService } from './tour-trail-details.service'; import { TourStopsMcp } from './tour-stops.mcp'; import { TourStopsService } from './tour-stops.service'; +import { TourTrailDetailsService } from './tour-trail-details.service'; import { TourTrailGradeController } from './tour-trail-grade.controller'; import { TourTrailGradeService } from './tour-trail-grade.service'; import { TourVisitsController } from './tour-visits.controller'; diff --git a/server/tests/unit/mcp/demo-tool-gate.test.ts b/server/tests/unit/mcp/demo-tool-gate.test.ts index 46f69ee26..372992254 100644 --- a/server/tests/unit/mcp/demo-tool-gate.test.ts +++ b/server/tests/unit/mcp/demo-tool-gate.test.ts @@ -15,7 +15,7 @@ import { db as testDb } from '../../../src/db/database'; import { DEMO_UNGATED_WRITE_TOOLS, isDemoGatedTool, trekDemoToolGate } from '../../../src/mcp/nest-mcp-policy'; import type { McpContext, McpRegistry, McpRegistryListing } from '../../../src/nest-mcp'; import { withRequestContext } from '../../../src/nest/database/request-context'; -import { createUser } from '../../helpers/factories'; +import { createUser, setAppSetting } from '../../helpers/factories'; import { createMcpTestRegistry } from '../../helpers/mcp-test-controllers'; import { bootTestApp } from '../../helpers/test-app'; import { resetTestDb, setAddonEnabled } from '../../helpers/test-db'; @@ -77,6 +77,8 @@ beforeAll(async () => { beforeEach(() => { resetTestDb(testDb); for (const id of Object.values(ADDON_IDS)) setAddonEnabled(testDb, id, true); + // The wanderer tools show only while wanderer is allowed under Tours. + setAppSetting(testDb, 'tours_wanderer_enabled', 'true'); }); afterEach(() => {