test: Created snapshot tests for all Radarr UI modules

This commit is contained in:
2025-12-15 20:17:09 -07:00
parent 7084ca1be2
commit 316ed64315
273 changed files with 8859 additions and 2031 deletions
@@ -27,6 +27,8 @@ mod tests {
}
mod snapshot_tests {
use crate::ui::ui_test_utils::test_utils::TerminalSize;
use super::*;
#[test]
@@ -59,7 +61,7 @@ mod tests {
BlockSelectionState::new(EDIT_INDEXER_TORRENT_SELECTION_BLOCKS);
app.data.sonarr_data.edit_indexer_modal = Some(EditIndexerModal::from(&app.data.sonarr_data));
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
EditIndexerUi::draw(f, app, f.area());
});
@@ -24,6 +24,8 @@ mod tests {
}
mod snapshot_tests {
use crate::ui::ui_test_utils::test_utils::TerminalSize;
use super::*;
#[test]
@@ -34,7 +36,7 @@ mod tests {
BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
app.data.sonarr_data.indexer_settings = Some(IndexerSettings::default());
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
IndexerSettingsUi::draw(f, app, f.area());
});
@@ -30,6 +30,8 @@ mod tests {
}
mod snapshot_tests {
use crate::ui::ui_test_utils::test_utils::TerminalSize;
use super::*;
#[test]
@@ -38,7 +40,7 @@ mod tests {
app.is_loading = true;
app.push_navigation_stack(ActiveSonarrBlock::Indexers.into());
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
IndexersUi::draw(f, app, f.area());
});
@@ -51,7 +53,7 @@ mod tests {
app.push_navigation_stack(ActiveSonarrBlock::Indexers.into());
app.data.sonarr_data.indexers = StatefulTable::default();
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
IndexersUi::draw(f, app, f.area());
});
@@ -81,7 +83,7 @@ mod tests {
},
]);
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
IndexersUi::draw(f, app, f.area());
});
@@ -2,26 +2,41 @@
source: src/ui/sonarr_ui/indexers/edit_indexer_ui_tests.rs
expression: output
---
╭───────────────────────────────── Edit Indexer ─────────────────────────────────╮
│ │
│ ╭─────────────────╮ ╭─────────────────╮ │
│ Name: ╰─────────────────╯ URL: ╰─────────────────╯ │
│ ╭───╮ ╭─────────────────╮ │
│ ╭───╮ API Key: ╰─────────────────╯ │
│ Enable Automatic Se╰───╯ ╭─────────────────╮
╭───╮ Tags: ╰─────────────────
╭─────────────────╮ │
Indexer Priority ▴▾╰─────────────────╯ │
╭──────────────────╮╭───────────────────╮
Save ││ Cancel
╰──────────────────╯╰───────────────────
╰──────────────────────────────────────────────────────────────────────────────────╯
╭──────────────────────────────────────────────── Edit Indexer ─────────────────────────────────────────────────╮
╭─────────────────────────╭─────────────────────────
Name: │Test Indexer │ URL: │https://test.indexer.com │ │
╰─────────────────────────╯ ╰─────────────────────────╯ │
╭───╮ ╭─────────────────────────╮ │
Enable RSS: │ ✔ │ API Key: │test-api-key
╰───╯ ╰─────────────────────────╯ │
╭───╮ ╭─────────────────────────
│ Enable Automatic Search: │ │ Tags: │ │ │
│ ╰───╯ ╰─────────────────────────╯ │
│ ╭───╮ ╭─────────────────────────╮ │
│ Enable Interactive Search: │ │ Indexer Priority ▴▾: │25 │ │
│ ╰───╯ ╰─────────────────────────╯ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ ╭───────────────────────────╮╭──────────────────────────╮ │
│ │ Save ││ Cancel │ │
│ ╰───────────────────────────╯╰──────────────────────────╯ │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
@@ -2,25 +2,39 @@
source: src/ui/sonarr_ui/indexers/indexer_settings_ui_tests.rs
expression: output
---
╭───────── Configure All Indexer Settings ─────────╮
│ ╭───────────────────────╮ │
│Minimum Age (minutes) ▴▾:│0 │ │
│ ╰───────────────────────╯ │
│ ╭───────────────────────╮ │
│ Retention (days) ▴▾: │0 │ │
───────────────────────╯
╭───────────────────────╮ │
│ Maximum Size (MB) ▴▾: │0
╰───────────────────────╯ │
╭───────────────────────╮ │
│RSS Sync Interval (minute│0 │ │
╰───────────────────────╯ │
╰────────────────────────────────────────────────────╯
╭─────────────────── Configure All Indexer Settings ───────────────────
╭────────────────────────────────╮ │
│ Minimum Age (minutes) ▴▾: │0 │ │
╰────────────────────────────────╯ │
│ ╭────────────────────────────────╮ │
│ Retention (days) ▴▾: │0 │ │
│ ╰────────────────────────────────╯ │
│ ╭────────────────────────────────╮ │
│ Maximum Size (MB) ▴▾: │0 │ │
│ ╰────────────────────────────────╯ │
│ ╭────────────────────────────────╮ │
│ RSS Sync Interval (minutes) ▴▾: │0 │ │
│ ╰────────────────────────────────╯ │
│ │
│ │
│ ╭────────────────╮╭────────────────╮ │
│ │ Save ││ Cancel │ │
│ ╰────────────────╯╰────────────────╯ │
╰────────────────────────────────────────────────────────────────────────╯
@@ -2,4 +2,4 @@
source: src/ui/sonarr_ui/indexers/indexers_ui_tests.rs
expression: output
---
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@@ -2,7 +2,7 @@
source: src/ui/sonarr_ui/indexers/indexers_ui_tests.rs
expression: output
---
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Loading ...
@@ -2,7 +2,7 @@
source: src/ui/sonarr_ui/indexers/indexers_ui_tests.rs
expression: output
---
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Indexer RSS Automatic Search Interactive Sea Priority Tags
=> Test Indexer 1 Enabled Enabled Enabled 25
Test Indexer 2 Disabled Disabled Disabled 0
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Indexer RSS Automatic Search Interactive Search Priority Tags
=> Test Indexer 1 Enabled Enabled Enabled 25
Test Indexer 2 Disabled Disabled Disabled 0
@@ -2,29 +2,47 @@
source: src/ui/sonarr_ui/indexers/test_all_indexers_ui_tests.rs
expression: output
---
╭ Test All Indexers ───────────────────────────────────────────────────────────────────╮
│ │
│ │
│ Loading ...
╰────────────────────────────────────────────────────────────────────────────────────────╯
╭ Test All Indexers ─────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Loading ...
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
@@ -20,6 +20,8 @@ mod tests {
}
mod snapshot_tests {
use crate::ui::ui_test_utils::test_utils::TerminalSize;
use super::*;
#[test]
@@ -28,7 +30,7 @@ mod tests {
app.is_loading = true;
app.push_navigation_stack(ActiveSonarrBlock::TestAllIndexers.into());
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
TestAllIndexersUi::draw(f, app, f.area());
});