test: cover indexer settings drawn over the indexers table
IndexersUi dispatches to IndexerSettingsUi, but no test rendered that route through the parent, so deleting the dispatch arm in radarr, sonarr and lidarr left the whole suite green.
This commit is contained in:
6 files changed
+169
No files matched your search
@@ -32,6 +32,7 @@ mod tests {
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::lidarr::lidarr_data::{
|
||||
EDIT_INDEXER_NZB_SELECTION_BLOCKS, EDIT_INDEXER_TORRENT_SELECTION_BLOCKS,
|
||||
INDEXER_SETTINGS_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::network::lidarr_network::lidarr_network_test_utils::test_utils::indexer;
|
||||
use crate::ui::ui_test_utils::test_utils::TerminalSize;
|
||||
@@ -152,5 +153,19 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexer_settings_over_indexers() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveLidarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.lidarr_data.selected_block =
|
||||
BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
---
|
||||
source: src/ui/lidarr_ui/indexers/indexers_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Indexer RSS Automatic Search Interactive Search Priority Tags
|
||||
=> Test Indexer Enabled Enabled Enabled 25 alex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────── Configure All Indexer Settings ───────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Minimum Age (minutes) ▴▾: │11 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Retention (days) ▴▾: │29 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Maximum Size (MB) ▴▾: │12345 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ RSS Sync Interval (minutes) ▴▾: │60 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭────────────────╮╭────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰────────────────╯╰────────────────╯ │
|
||||
╰────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -29,6 +29,9 @@ mod tests {
|
||||
}
|
||||
|
||||
mod snapshot_tests {
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::radarr::radarr_data::INDEXER_SETTINGS_SELECTION_BLOCKS;
|
||||
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
@@ -120,5 +123,19 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexer_settings_over_indexers() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/indexers_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Indexer ▼ RSS Automatic Search Interactive Search Priority Tags
|
||||
=> Test Indexer Enabled Enabled Enabled 25 alex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────── Configure All Indexer Settings ────────────────────────────────────────╮
|
||||
│ │
|
||||
│ ╭─────────────────────────╮ ╭─────────────────────────╮ │
|
||||
│ Minimum Age (minutes) ▴▾: │12 │ Availability Delay (days) │0 │ │
|
||||
│ ╰─────────────────────────╯ ╰─────────────────────────╯ │
|
||||
│ ╭─────────────────────────╮ ╭─────────────────────────╮ │
|
||||
│ Retention (days) ▴▾: │30 │ RSS Sync Interval (minutes│60 │ │
|
||||
│ ╰─────────────────────────╯ ╰─────────────────────────╯ │
|
||||
│ ╭─────────────────────────╮ ╭─────────────────────────╮ │
|
||||
│ Maximum Size (MB) ▴▾: │1234 │ Whitelisted Subtitle Tags:│eng │ │
|
||||
│ ╰─────────────────────────╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭───╮ │
|
||||
│ Prefer Indexer Flags: │ ✔ │ Allow Hardcoded Subs: │ ✔ │ │
|
||||
│ ╰───╯ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───────────────────────────╮╭──────────────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰───────────────────────────╯╰──────────────────────────╯ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -32,6 +32,7 @@ mod tests {
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
EDIT_INDEXER_NZB_SELECTION_BLOCKS, EDIT_INDEXER_TORRENT_SELECTION_BLOCKS,
|
||||
INDEXER_SETTINGS_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::network::sonarr_network::sonarr_network_test_utils::test_utils::indexer;
|
||||
use crate::ui::ui_test_utils::test_utils::TerminalSize;
|
||||
@@ -152,5 +153,19 @@ mod tests {
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexer_settings_over_indexers() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveSonarrBlock::AllIndexerSettingsPrompt.into());
|
||||
app.data.sonarr_data.selected_block =
|
||||
BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
---
|
||||
source: src/ui/sonarr_ui/indexers/indexers_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Indexer RSS Automatic Search Interactive Search Priority Tags
|
||||
=> Test Indexer Enabled Enabled Enabled 25 alex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────── Configure All Indexer Settings ───────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Minimum Age (minutes) ▴▾: │13 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Retention (days) ▴▾: │21 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ Maximum Size (MB) ▴▾: │12345 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────╮ │
|
||||
│ RSS Sync Interval (minutes) ▴▾: │60 │ │
|
||||
│ ╰────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭────────────────╮╭────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰────────────────╯╰────────────────╯ │
|
||||
╰────────────────────────────────────────────────────────────────────────╯
|
||||
Reference in new issue
Block a user