test(workbench-ui): simplify practice evidence assertions
This commit is contained in:
parent
62aeba9d62
commit
0aa217f917
1 changed files with 27 additions and 32 deletions
|
|
@ -139,35 +139,31 @@ describe("practice evidence panel model", () => {
|
||||||
{ key: "geometric_search_run", value: "recorded — gsr_1" },
|
{ key: "geometric_search_run", value: "recorded — gsr_1" },
|
||||||
{ key: "replay_results", value: "missing_evidence — none" },
|
{ key: "replay_results", value: "missing_evidence — none" },
|
||||||
]);
|
]);
|
||||||
expect(model.authorityRows).toEqual(
|
expect(model.authorityRows).toContainEqual({ key: "diagnostic_only", value: "true" });
|
||||||
expect.arrayContaining([
|
expect(model.authorityRows).toContainEqual({ key: "serving_allowed", value: "false" });
|
||||||
{ key: "diagnostic_only", value: "true" },
|
expect(model.authorityRows).toContainEqual({ key: "mutation_allowed", value: "false" });
|
||||||
{ key: "serving_allowed", value: "false" },
|
expect(model.authorityRows).toContainEqual({ key: "replay_execution_allowed", value: "false" });
|
||||||
{ key: "mutation_allowed", value: "false" },
|
expect(model.authorityRows).toContainEqual({
|
||||||
{ key: "replay_execution_allowed", value: "false" },
|
key: "replay_executed_by_workbench",
|
||||||
{ key: "replay_executed_by_workbench", value: "false" },
|
value: "false",
|
||||||
]),
|
});
|
||||||
);
|
|
||||||
|
|
||||||
const chain = model.detailSections.find((section) => section.title === "Evidence chain");
|
const chain = model.detailSections.find((section) => section.title === "Evidence chain");
|
||||||
expect(chain?.items[1]).toMatchObject({
|
if (chain === undefined) throw new Error("missing Evidence chain section");
|
||||||
title: "card 2: geometric_search_run",
|
const geometricSearchCard = chain.items.find((item) => item.title === "card 2: geometric_search_run");
|
||||||
rows: expect.arrayContaining([
|
if (geometricSearchCard === undefined) throw new Error("missing geometric search card");
|
||||||
{
|
expect(geometricSearchCard.rows).toContainEqual({
|
||||||
key: "authority",
|
key: "authority",
|
||||||
value:
|
value:
|
||||||
"identity card only; Workbench does not execute search, replay, operators, sealing, or mutation",
|
"identity card only; Workbench does not execute search, replay, operators, sealing, or mutation",
|
||||||
},
|
|
||||||
]),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const sealed = model.detailSections.find((section) => section.title === "Sealed trace");
|
const sealed = model.detailSections.find((section) => section.title === "Sealed trace");
|
||||||
expect(sealed?.items[0]?.rows ?? []).toEqual(
|
if (sealed === undefined) throw new Error("missing Sealed trace section");
|
||||||
expect.arrayContaining([
|
const sealedTrace = sealed.items.find((item) => item.title === "spt_1");
|
||||||
{ key: "geometric_search_run_id", value: "gsr_1" },
|
if (sealedTrace === undefined) throw new Error("missing sealed trace item");
|
||||||
{ key: "replay_refusal_ids", value: "rr_1" },
|
expect(sealedTrace.rows).toContainEqual({ key: "geometric_search_run_id", value: "gsr_1" });
|
||||||
]),
|
expect(sealedTrace.rows).toContainEqual({ key: "replay_refusal_ids", value: "rr_1" });
|
||||||
);
|
|
||||||
expect(model.sourceSpanRows).toEqual([
|
expect(model.sourceSpanRows).toEqual([
|
||||||
{ key: "sealed_trace.1", value: "0:20 Lena has 3 marbles. (sentence 0)" },
|
{ key: "sealed_trace.1", value: "0:20 Lena has 3 marbles. (sentence 0)" },
|
||||||
]);
|
]);
|
||||||
|
|
@ -181,12 +177,11 @@ describe("practice evidence panel model", () => {
|
||||||
expect(model.chainRows).toEqual([{ key: "trace_refusal", value: "recorded — ptr_1" }]);
|
expect(model.chainRows).toEqual([{ key: "trace_refusal", value: "recorded — ptr_1" }]);
|
||||||
|
|
||||||
const refusal = model.detailSections.find((section) => section.title === "Trace refusal");
|
const refusal = model.detailSections.find((section) => section.title === "Trace refusal");
|
||||||
expect(refusal?.items[0]?.rows ?? []).toEqual(
|
if (refusal === undefined) throw new Error("missing Trace refusal section");
|
||||||
expect.arrayContaining([
|
const refusalItem = refusal.items.find((item) => item.title === "ptr_1");
|
||||||
{ key: "trace_refusal_id", value: "ptr_1" },
|
if (refusalItem === undefined) throw new Error("missing trace refusal item");
|
||||||
{ key: "reason_codes", value: "missing_residual" },
|
expect(refusalItem.rows).toContainEqual({ key: "trace_refusal_id", value: "ptr_1" });
|
||||||
{ key: "explanation", value: "no residual target" },
|
expect(refusalItem.rows).toContainEqual({ key: "reason_codes", value: "missing_residual" });
|
||||||
]),
|
expect(refusalItem.rows).toContainEqual({ key: "explanation", value: "no residual target" });
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue