fix(audit): expose verified visit exports and export-only recovery
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
import { PipelinesRepository } from "../src/repository.js";
|
||||
|
||||
test("web export retry names the exact recorded visit and sends no execution request", async () => {
|
||||
const sent=[];const detail={id:19,status:"succeeded"};
|
||||
const repo=new PipelinesRepository({call:async frame=>{sent.push(frame);return {run_detail:detail};}});
|
||||
assert.equal(await repo.repairSessionExport(19,4),detail);
|
||||
assert.deepEqual(sent,[{type:"repair_session_export",run_id:19,export_sequence:4}]);
|
||||
});
|
||||
|
||||
test("web export retry refuses an unknown run or visit before any request", async () => {
|
||||
let calls=0;const repo=new PipelinesRepository({call:async()=>{calls++;}});
|
||||
for(const [id,sequence] of [[0,1],[19,0],[19,-1],[19,1.5]]) await assert.rejects(repo.repairSessionExport(id,sequence));
|
||||
assert.equal(calls,0);
|
||||
});
|
||||
Reference in New Issue
Block a user