This commit is contained in:
@@ -4,6 +4,10 @@ import type { PoiCategoryId } from '@/domain/poiCategories'
|
||||
import type { GuideRepository } from '@/repositories/GuideRepository'
|
||||
import type { GuideModelRepository } from '@/repositories/GuideModelRepository'
|
||||
import { GuideUseCase } from '@/usecases/guideUseCase'
|
||||
import {
|
||||
clearGuidePerformanceRecords,
|
||||
getGuidePerformanceRecords
|
||||
} from '@/services/performance/guidePerformance'
|
||||
|
||||
const floors: MuseumFloor[] = [
|
||||
{ id: 'L1', label: '1F', order: 1 },
|
||||
@@ -91,6 +95,30 @@ const expectMapListParity = (state: { results: MuseumPoi[], visiblePoiIds: strin
|
||||
}
|
||||
|
||||
describe('GuideUseCase point search state', () => {
|
||||
it('records the resolved floor and result count for a keyword search', async () => {
|
||||
clearGuidePerformanceRecords()
|
||||
const repository = createRepository()
|
||||
const useCase = new GuideUseCase(
|
||||
repository as unknown as GuideRepository,
|
||||
{} as GuideModelRepository
|
||||
)
|
||||
|
||||
await useCase.searchPoiKeyword(null, 'shop', 'L2')
|
||||
|
||||
expect(getGuidePerformanceRecords()).toEqual(expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
kind: 'interaction',
|
||||
name: 'poi-search-data',
|
||||
outcome: 'success',
|
||||
detail: expect.objectContaining({
|
||||
mode: 'keyword',
|
||||
floorId: 'L2',
|
||||
resultCount: 1
|
||||
})
|
||||
})
|
||||
]))
|
||||
})
|
||||
|
||||
it('loads initial destinations through listDestinationPois and never searchPois', async () => {
|
||||
const repository = createRepository()
|
||||
const useCase = new GuideUseCase(
|
||||
|
||||
Reference in New Issue
Block a user