test(#2591): assert hivectl header shows source, not a derived label

This commit is contained in:
atlas 2026-07-23 17:57:32 +02:00 committed by mara
commit c7feeb7f5b

View file

@ -337,10 +337,12 @@ mod tests {
}
#[test]
fn render_dag_line_shows_chain_with_derived_label_and_state() {
// Roll-up state (Running) + label ("rebuild") are derived from the node
// set — the wire no longer carries them. (`Done` nodes are included
// here to exercise glyph rendering; production filters them off.)
fn render_dag_line_shows_source_and_chain() {
// The header shows what the backend sends: the roll-up state glyph
// (derived — Running here) + the DAG `source` ("manual"); the operation
// is read off the node chain, not a client-side label. (`Done` nodes
// are included here to exercise glyph rendering; production filters
// them off.)
let dag = DagView {
id: 7,
source: Source::Manual,
@ -356,7 +358,7 @@ mod tests {
],
};
let line = render_dag_line(&dag);
assert!(line.starts_with("rebuild alice"), "{line}");
assert!(line.starts_with("manual alice"), "{line}");
assert!(
line.contains("✔ prebuild → ✔ stop_for_update → ▶ swap → ⏸ reconcile"),
"{line}"
@ -377,7 +379,7 @@ mod tests {
nodes: vec![failed],
};
let line = render_dag_line(&dag);
assert!(line.contains("rebuild"), "{line}");
assert!(line.contains("manual"), "{line}");
assert!(line.contains("— nix build exploded"), "{line}");
}
}