Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion bin/aas-gui.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ export function compareModel(result) {
: "";
const differences = Array.isArray(body.differences) ? body.differences : [];
const rows = differences.length === 0
? "<p>No compared field differs.</p>"
? (body.classification === "not-comparable"
? "<p>Comparison unavailable.</p>"
: "<p>No compared field differs.</p>")
: `<ul>${differences.map((entry) => `<li>${escapeHtml(entry.field)}: ${escapeHtml(JSON.stringify(entry.left))} vs ${escapeHtml(JSON.stringify(entry.right))}</li>`).join("")}</ul>`;
const notes = Array.isArray(body.notes) && body.notes.length > 0
? body.notes
Expand Down
11 changes: 11 additions & 0 deletions test/gui.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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/);
});


Expand Down
Loading