test(radarr): pin table search, filter and selection behaviour

Radarr handler tests never asserted which block the search and filter keys
push, so transposing searching_block and filtering_block in a
TableHandlingConfig went undetected. Add a search key and a filter key test
for each of the three handlers that configure them: library, collections and
history.

No test moved a table or list selection off index 0 either, which made
current_selection() and items[0] indistinguishable. Select a non-zero index
in the tests covering every handler that reads a selected row, enriching
fixtures with a second, distinct entry where only one existed.

Several fixtures also asserted against a default value, so the expected
result was indistinguishable from an unset field. The system details tasks
now use two distinct non-default task names, and the add movie body expects
a non-default monitor and minimum availability.
This commit is contained in:
Dark-Alex-17 committed 2026-09-09 10:47:07 -06:00
1 parent c9244b0459
commit 4cbec79334
16 files changed
+481 -133

No files matched your search

@@ -381,6 +381,48 @@ mod tests {
assert!(!app.should_refresh);
}
#[test]
fn test_search_collections_key() {
let mut app = App::test_default();
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
app
.data
.radarr_data
.collections
.set_items(vec![Collection::default()]);
CollectionsHandler::new(
DEFAULT_KEYBINDINGS.search.key,
&mut app,
ActiveRadarrBlock::Collections,
None,
)
.handle();
assert_navigation_pushed!(app, ActiveRadarrBlock::SearchCollection.into());
}
#[test]
fn test_filter_collections_key() {
let mut app = App::test_default();
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
app
.data
.radarr_data
.collections
.set_items(vec![Collection::default()]);
CollectionsHandler::new(
DEFAULT_KEYBINDINGS.filter.key,
&mut app,
ActiveRadarrBlock::Collections,
None,
)
.handle();
assert_navigation_pushed!(app, ActiveRadarrBlock::FilterCollections.into());
}
#[test]
fn test_update_all_collections_prompt_confirm_confirm() {
let mut app = App::test_default();