Update planner, check-in records, location service and tests
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
type PlanResponse,
|
||||
resolveCanonicalPoiId,
|
||||
type TravelPreferences,
|
||||
TravelValidationError,
|
||||
} from '../src/domain/travel'
|
||||
import {
|
||||
createPlan,
|
||||
@@ -222,13 +223,22 @@ describe('deterministic local POC planner', () => {
|
||||
})
|
||||
|
||||
it('rejects a quick plan when even the first stop cannot fit the budget', () => {
|
||||
expect(() => createLocalPlan({
|
||||
mode: 'quick',
|
||||
preferences: preferences({ pace: 'relaxed', transport: 'walking' }),
|
||||
durationMinutes: 120,
|
||||
selectedPoiIds: [],
|
||||
origin: { longitude: 114.3, latitude: 22.3, coordinateSystem: 'GCJ02' },
|
||||
}, repository)).toThrow('没有可用于规划的地点')
|
||||
let thrown: unknown
|
||||
try {
|
||||
createLocalPlan({
|
||||
mode: 'quick',
|
||||
preferences: preferences({ pace: 'relaxed', transport: 'walking' }),
|
||||
durationMinutes: 120,
|
||||
selectedPoiIds: [],
|
||||
origin: { longitude: 114.3, latitude: 22.3, coordinateSystem: 'GCJ02' },
|
||||
}, repository)
|
||||
}
|
||||
catch (error) {
|
||||
thrown = error
|
||||
}
|
||||
|
||||
expect(thrown).toBeInstanceOf(TravelValidationError)
|
||||
expect(thrown).toMatchObject({ code: 'quick_route_unreachable' })
|
||||
})
|
||||
|
||||
it('returns the same route and canonical IDs for equivalent input', () => {
|
||||
|
||||
Reference in New Issue
Block a user