From f7c67ad58b942c859d7e19238f3f2e6efd964302 Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Thu, 10 Sep 2026 00:53:07 -0600 Subject: [PATCH] test(radarr): cover the updates popup empty state Radarr was the only tree without a test rendering draw_updates_popup with no update text, leaving its loading branch unreachable from the suite. Forcing the guard true went undetected. --- ...ui_renders_updates_loading_when_empty.snap | 48 +++++++++++++++++++ .../system/system_details_ui_tests.rs | 15 ++++++ 2 files changed, 63 insertions(+) create mode 100644 src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_renders_updates_loading_when_empty.snap diff --git a/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_renders_updates_loading_when_empty.snap b/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_renders_updates_loading_when_empty.snap new file mode 100644 index 00000000..c8e5896f --- /dev/null +++ b/src/ui/radarr_ui/system/snapshots/managarr__ui__radarr_ui__system__system_details_ui__system_details_ui_tests__tests__snapshot_tests__system_details_ui_renders_updates_loading_when_empty.snap @@ -0,0 +1,48 @@ +--- +source: src/ui/radarr_ui/system/system_details_ui_tests.rs +expression: output +--- + + + + + + + ╭ Updates ───────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ + │ │ + │ │ + │ Loading ... │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + │ │ + ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ diff --git a/src/ui/radarr_ui/system/system_details_ui_tests.rs b/src/ui/radarr_ui/system/system_details_ui_tests.rs index 2277f3ad..77f5ef37 100644 --- a/src/ui/radarr_ui/system/system_details_ui_tests.rs +++ b/src/ui/radarr_ui/system/system_details_ui_tests.rs @@ -24,6 +24,7 @@ mod tests { mod snapshot_tests { use super::*; + use crate::models::ScrollableText; use rstest::rstest; #[rstest] @@ -85,5 +86,19 @@ mod tests { insta::assert_snapshot!(output); } + + #[test] + fn test_system_details_ui_renders_updates_loading_when_empty() { + let mut app = App::test_default_fully_populated(); + app.is_loading = true; + app.push_navigation_stack(ActiveRadarrBlock::SystemUpdates.into()); + app.data.radarr_data.updates = ScrollableText::with_string("".to_string()); + + let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| { + SystemDetailsUi::draw(f, app, f.area()); + }); + + insta::assert_snapshot!(output); + } } }