Skip to content

Commit 8b83eea

Browse files
committed
test: cover visual identity helpers
1 parent 4ac5caf commit 8b83eea

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

crates/deadreckon/src/main.rs

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20526,12 +20526,12 @@ mod tui_tests {
2052620526
CompletionAction, ProviderActivity, ProviderJsonlLogSpec, acceptance_activity_lines,
2052720527
attach_banner, attach_header_text, attach_should_return_to_plan, chain_activity_lines,
2052820528
chain_attach_footer_text, chain_attach_header_text, chain_should_auto_attach,
20529-
chain_timeline_lines, chain_wall_cap_hit, claude_project_name_for_workdir,
20529+
chain_step_dot, chain_timeline_lines, chain_wall_cap_hit, claude_project_name_for_workdir,
2053020530
cli_wait_status_line, collect_jsonl_provider_activity, completion_action_from_input,
2053120531
completion_hints_enabled, deadreckoning_course_ascii, deadreckoning_status_text,
2053220532
doc_polish_preview_text, implementation_plan_warnings, kill_banner, live_file_lines,
20533-
markdown_to_tui_lines, max_panel_scroll, per_step_wall_cap, plan_attach_footer,
20534-
provider_ingest_base_roots, provider_jsonl_activity_lines,
20533+
markdown_to_tui_lines, max_panel_scroll, meter_color, per_step_wall_cap,
20534+
plan_attach_footer, provider_ingest_base_roots, provider_jsonl_activity_lines,
2053520535
provider_jsonl_log_spec_from_registry, provider_jsonl_session_matches_run,
2053620536
read_plan_events_lossy, recommend_child_count_for_goal, recommend_orchestration_mode,
2053720537
render_attach, render_plan_attach, threshold_color,
@@ -21324,6 +21324,18 @@ mod tui_tests {
2132421324
assert_eq!(threshold_color(0.80), Color::Red);
2132521325
}
2132621326

21327+
#[test]
21328+
fn spend_gauge_uses_gradient_and_pause_cap_palette() {
21329+
let (_temp, mut state) = doc_preview_state();
21330+
21331+
assert_eq!(meter_color(0.30, &state), Color::Green);
21332+
assert_eq!(meter_color(0.70, &state), Color::Yellow);
21333+
assert_eq!(meter_color(0.90, &state), Color::Red);
21334+
21335+
state.pause_reason = Some("spend cap reached".to_string());
21336+
assert_eq!(meter_color(0.90, &state), Color::Magenta);
21337+
}
21338+
2132721339
#[test]
2132821340
fn deadreckoning_course_animation_moves() {
2132921341
let first = deadreckoning_course_ascii(16, 0);
@@ -21334,6 +21346,22 @@ mod tui_tests {
2133421346
assert_eq!(first.chars().count(), 16);
2133521347
}
2133621348

21349+
#[test]
21350+
fn deadreckoning_course_strip_matches_identity_golden() {
21351+
assert_eq!(deadreckoning_course_ascii(18, 0), "*--.--.^-.--.-^.--");
21352+
}
21353+
21354+
#[test]
21355+
fn chain_step_glyphs_match_identity_set() {
21356+
assert_eq!(chain_step_dot(ChainStepStatus::Pending), "○");
21357+
assert_eq!(chain_step_dot(ChainStepStatus::Running), "●");
21358+
assert_eq!(chain_step_dot(ChainStepStatus::Completed), "◐");
21359+
assert_eq!(chain_step_dot(ChainStepStatus::Failed), "✗");
21360+
assert_eq!(chain_step_dot(ChainStepStatus::Skipped), "↷");
21361+
assert_eq!(chain_step_dot(ChainStepStatus::Applied), "◉");
21362+
assert_eq!(chain_step_dot(ChainStepStatus::Undone), "↶");
21363+
}
21364+
2133721365
#[test]
2133821366
fn attach_footer_status_names_running_state() {
2133921367
let (_temp, mut state) = doc_preview_state();

0 commit comments

Comments
 (0)