test(fleet): cover partial returns and redispatch through real API flow

This commit is contained in:
2026-10-03 16:11:52 +08:00
parent 8700fc3423
commit d05ff1cd26
4 changed files with 395 additions and 3 deletions
@@ -18,6 +18,14 @@ test('fleet entry defaults to a no-side-effect plan and requires explicit TEST a
for (const output of ['reports/../outside', 'C:/temp/output', 'reports', 'reports/nested/path']) assert.throws(() => parseFleetArguments(['--output', output]))
})
test('return redispatch is explicit, fresh-only and declares source-event proof separately', () => {
const config = parseFleetArguments(['--plan', '--environment', 'TEST', '--run-id', 'return-new', '--scenario', 'return-redispatch'])
const plan = fleetExecutionPlan(config)
assert.equal(plan.scenario, 'return-redispatch'); assert.ok(plan.returnRedispatch.required.includes('Two current-run domestic sources'))
assert.throws(() => parseFleetArguments(['--scenario', 'return-redispatch', '--resume-report', 'reports/old/report.json', '--resume-stage', 'FULL_COVERAGE']), /fresh run/)
assert.throws(() => parseFleetArguments(['--scenario', 'unknown']))
})
test('handover stage exports only a verified same-run departure fixture before the optional UI checkpoint', async () => {
const order = [], departure = { tripNo: 'TR-NEW', status: 'IN_TRANSIT' }
const context = { marker: 'CURRENT', context: { saveFleetHandoverFixture(value) { order.push('save'); assert.equal(value.marker, 'CURRENT') } },