diff --git a/CHANGELOG.md b/CHANGELOG.md index 2565cd9..a250b6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ project adheres to [Semantic Versioning](https://semver.org/). - Playwright setup note in the Quick start section of `README.md`. ### Fixed +- The workbench comparison panel now says the comparison is unavailable when + the pair is not comparable. It previously said no compared field differs, + which disagreed with the Markdown download for the same result. - Comparison and case summaries now refuse a `runs` directory that is a symlink, matching list, export, and prune. The comparison path used to follow the link and read the target tree. The GUI compare route returns diff --git a/bin/aas-gui.mjs b/bin/aas-gui.mjs index efd2b43..a5b15cf 100644 --- a/bin/aas-gui.mjs +++ b/bin/aas-gui.mjs @@ -225,7 +225,9 @@ export function compareModel(result) { : ""; const differences = Array.isArray(body.differences) ? body.differences : []; const rows = differences.length === 0 - ? "

No compared field differs.

" + ? (body.classification === "not-comparable" + ? "

Comparison unavailable.

" + : "

No compared field differs.

") : ``; const notes = Array.isArray(body.notes) && body.notes.length > 0 ? body.notes diff --git a/test/gui.test.mjs b/test/gui.test.mjs index e3585db..3a589d2 100644 --- a/test/gui.test.mjs +++ b/test/gui.test.mjs @@ -551,6 +551,17 @@ test("history and comparison models escape untrusted values and state limits", ( const empty = compareModel({ classification: "identical", left: { run_id: "a" }, right: { run_id: "b" } }); assert.match(empty, /No compared field differs/); + + const unavailable = compareModel({ + classification: "not-comparable", + left: null, + right: null, + errors: ["left (missing): Cannot read run missing."], + differences: [], + }); + assert.match(unavailable, /Comparison unavailable/); + assert.doesNotMatch(unavailable, /No compared field differs/); + assert.match(unavailable, /Cannot read run missing/); });