test: Created snapshot tests for all Radarr UI modules
This commit is contained in:
+194
-1
@@ -19,9 +19,25 @@ use crate::models::servarr_models::KeybindingItem;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::models::{HorizontallyScrollableText, Route, TabRoute, TabState};
|
||||
use crate::network::NetworkEvent;
|
||||
#[cfg(test)]
|
||||
use {
|
||||
crate::models::ScrollableText,
|
||||
crate::models::radarr_models,
|
||||
crate::models::radarr_models::MinimumAvailability,
|
||||
crate::models::radarr_models::MovieMonitor,
|
||||
crate::models::servarr_data::modals::EditIndexerModal,
|
||||
crate::models::servarr_data::radarr::modals::AddMovieModal,
|
||||
crate::models::servarr_data::radarr::modals::{
|
||||
EditCollectionModal, EditMovieModal, MovieDetailsModal,
|
||||
},
|
||||
crate::network::radarr_network::radarr_network_test_utils::test_utils::*,
|
||||
chrono::DateTime,
|
||||
strum::IntoEnumIterator,
|
||||
std::fmt::Debug,
|
||||
crate::models::stateful_table::SortOption
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "app_tests.rs"]
|
||||
mod app_tests;
|
||||
pub mod context_clues;
|
||||
pub mod key_binding;
|
||||
@@ -29,6 +45,16 @@ mod key_binding_tests;
|
||||
pub mod radarr;
|
||||
pub mod sonarr;
|
||||
|
||||
#[cfg(test)]
|
||||
macro_rules! sort_option {
|
||||
($field:ident) => {
|
||||
SortOption {
|
||||
name: "Something",
|
||||
cmp_fn: Some(|a, b| a.$field.cmp(&b.$field))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct App<'a> {
|
||||
navigation_stack: Vec<Route>,
|
||||
network_tx: Option<Sender<NetworkEvent>>,
|
||||
@@ -259,6 +285,173 @@ impl App<'_> {
|
||||
..App::default()
|
||||
}
|
||||
}
|
||||
|
||||
pub fn test_default_fully_populated() -> Self {
|
||||
let quality_profile_name = "HD - 1080p".to_owned();
|
||||
let mut add_movie_modal = AddMovieModal {
|
||||
tags: "alex".into(),
|
||||
..AddMovieModal::default()
|
||||
};
|
||||
add_movie_modal
|
||||
.root_folder_list
|
||||
.set_items(vec![root_folder()]);
|
||||
add_movie_modal
|
||||
.monitor_list
|
||||
.set_items(MovieMonitor::iter().collect());
|
||||
add_movie_modal
|
||||
.minimum_availability_list
|
||||
.set_items(MinimumAvailability::iter().collect());
|
||||
add_movie_modal
|
||||
.quality_profile_list
|
||||
.set_items(vec![quality_profile_name.clone()]);
|
||||
|
||||
let mut add_movie_search_result_table = StatefulTable::default();
|
||||
add_movie_search_result_table.set_items(vec![add_movie_search_result()]);
|
||||
add_movie_search_result_table.sorting(vec![sort_option!(tmdb_id)]);
|
||||
add_movie_search_result_table.search = Some("something".into());
|
||||
add_movie_search_result_table.filter = Some("something".into());
|
||||
|
||||
let mut edit_movie_modal = EditMovieModal {
|
||||
monitored: Some(true),
|
||||
path: "/nfs/movies".into(),
|
||||
tags: "alex".into(),
|
||||
..EditMovieModal::default()
|
||||
};
|
||||
edit_movie_modal
|
||||
.minimum_availability_list
|
||||
.set_items(MinimumAvailability::iter().collect());
|
||||
edit_movie_modal
|
||||
.quality_profile_list
|
||||
.set_items(vec![quality_profile_name.clone()]);
|
||||
|
||||
let mut edit_collection_modal = EditCollectionModal {
|
||||
monitored: Some(true),
|
||||
path: "/nfs/movies".into(),
|
||||
search_on_add: Some(true),
|
||||
..EditCollectionModal::default()
|
||||
};
|
||||
edit_collection_modal
|
||||
.minimum_availability_list
|
||||
.set_items(MinimumAvailability::iter().collect());
|
||||
edit_collection_modal
|
||||
.quality_profile_list
|
||||
.set_items(vec![quality_profile_name.clone()]);
|
||||
|
||||
let edit_indexer_modal = EditIndexerModal {
|
||||
name: "DrunkenSlug".into(),
|
||||
enable_rss: Some(true),
|
||||
enable_automatic_search: Some(true),
|
||||
enable_interactive_search: Some(true),
|
||||
url: "http://127.0.0.1:9696/1/".into(),
|
||||
api_key: "someApiKey".into(),
|
||||
seed_ratio: "ratio".into(),
|
||||
tags: "25".into(),
|
||||
priority: 1,
|
||||
};
|
||||
|
||||
let indexer_settings = radarr_models::IndexerSettings {
|
||||
allow_hardcoded_subs: true,
|
||||
availability_delay: 0,
|
||||
id: 1,
|
||||
maximum_size: 1234,
|
||||
minimum_age: 12,
|
||||
prefer_indexer_flags: true,
|
||||
retention: 30,
|
||||
rss_sync_interval: 60,
|
||||
whitelisted_hardcoded_subs: "eng".into(),
|
||||
};
|
||||
|
||||
let mut indexer_test_results = StatefulTable::default();
|
||||
indexer_test_results.set_items(vec![indexer_test_result()]);
|
||||
indexer_test_results.sorting(vec![sort_option!(name)]);
|
||||
indexer_test_results.search = Some("something".into());
|
||||
indexer_test_results.filter = Some("something".into());
|
||||
|
||||
let mut movie_details_modal = MovieDetailsModal {
|
||||
movie_details: ScrollableText::with_string("Some information".to_owned()),
|
||||
file_details: "Some file info".to_owned(),
|
||||
audio_details: "Some audio info".to_owned(),
|
||||
video_details: "Some video info".to_owned(),
|
||||
..MovieDetailsModal::default()
|
||||
};
|
||||
movie_details_modal
|
||||
.movie_history
|
||||
.set_items(vec![movie_history_item()]);
|
||||
movie_details_modal
|
||||
.movie_cast
|
||||
.set_items(vec![cast_credit()]);
|
||||
movie_details_modal
|
||||
.movie_crew
|
||||
.set_items(vec![crew_credit()]);
|
||||
movie_details_modal
|
||||
.movie_releases
|
||||
.set_items(vec![torrent_release(), usenet_release()]);
|
||||
movie_details_modal.movie_releases.sorting(vec![sort_option!(indexer_id)]);
|
||||
|
||||
let mut radarr_data = RadarrData {
|
||||
disk_space_vec: vec![diskspace()],
|
||||
version: "1.2.3.4".to_owned(),
|
||||
quality_profile_map: quality_profile_map(),
|
||||
tags_map: tags_map(),
|
||||
updates: updates(),
|
||||
start_time: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T21:29:16Z").unwrap()),
|
||||
add_movie_search: Some("test".into()),
|
||||
add_movie_modal: Some(add_movie_modal),
|
||||
add_searched_movies: Some(add_movie_search_result_table),
|
||||
edit_movie_modal: Some(edit_movie_modal),
|
||||
edit_collection_modal: Some(edit_collection_modal),
|
||||
edit_indexer_modal: Some(edit_indexer_modal),
|
||||
edit_root_folder: Some("/nfs/movies".into()),
|
||||
indexer_settings: Some(indexer_settings),
|
||||
indexer_test_errors: Some("error".into()),
|
||||
indexer_test_all_results: Some(indexer_test_results),
|
||||
movie_details_modal: Some(movie_details_modal),
|
||||
delete_movie_files: true,
|
||||
..RadarrData::default()
|
||||
};
|
||||
radarr_data.root_folders.set_items(vec![root_folder()]);
|
||||
radarr_data.movies.set_items(vec![movie()]);
|
||||
radarr_data.movies.sorting(vec![sort_option!(id)]);
|
||||
radarr_data.movies.search = Some("Something".into());
|
||||
radarr_data.movies.filter = Some("Something".into());
|
||||
radarr_data.collections.set_items(vec![collection()]);
|
||||
radarr_data.collections.sorting(vec![sort_option!(id)]);
|
||||
radarr_data.collections.search = Some("Something".into());
|
||||
radarr_data.collections.filter = Some("Something".into());
|
||||
radarr_data.collection_movies.set_items(vec![collection_movie()]);
|
||||
radarr_data.downloads.set_items(vec![download_record()]);
|
||||
radarr_data.blocklist.set_items(vec![blocklist_item()]);
|
||||
radarr_data.blocklist.sorting(vec![sort_option!(id)]);
|
||||
radarr_data.indexers.set_items(vec![indexer()]);
|
||||
radarr_data.indexers.sorting(vec![sort_option!(id)]);
|
||||
radarr_data.indexers.search = Some("Something".into());
|
||||
radarr_data.indexers.filter = Some("Something".into());
|
||||
radarr_data.logs.set_items(vec![log_line().into()]);
|
||||
radarr_data.log_details.set_items(vec![log_line().into()]);
|
||||
radarr_data.tasks.set_items(vec![task()]);
|
||||
radarr_data.queued_events.set_items(vec![queued_event()]);
|
||||
App {
|
||||
data: Data {
|
||||
radarr_data,
|
||||
sonarr_data: SonarrData::default(),
|
||||
},
|
||||
server_tabs: TabState::new(vec![
|
||||
TabRoute {
|
||||
title: "Radarr".to_owned(),
|
||||
route: ActiveRadarrBlock::Movies.into(),
|
||||
contextual_help: None,
|
||||
config: Some(ServarrConfig::default()),
|
||||
},
|
||||
TabRoute {
|
||||
title: "Sonarr".to_owned(),
|
||||
route: ActiveSonarrBlock::Series.into(),
|
||||
contextual_help: None,
|
||||
config: Some(ServarrConfig::default()),
|
||||
},
|
||||
]),
|
||||
..App::default()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
+1
-1
@@ -130,7 +130,7 @@ pub fn handle_events(key: Key, app: &mut App<'_>) {
|
||||
}
|
||||
}
|
||||
|
||||
fn populate_keymapping_table(app: &mut App<'_>) {
|
||||
pub fn populate_keymapping_table(app: &mut App<'_>) {
|
||||
let context_clue_to_keybinding_item = |key: &KeyBinding, desc: &&str| {
|
||||
let (key, alt_key) = if key.alt.is_some() {
|
||||
(key.key.to_string(), key.alt.as_ref().unwrap().to_string())
|
||||
|
||||
@@ -25,6 +25,8 @@ use bimap::BiMap;
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde_json::Number;
|
||||
use strum::EnumIter;
|
||||
#[cfg(test)]
|
||||
use strum_macros::{Display, EnumString};
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "radarr_data_tests.rs"]
|
||||
@@ -224,6 +226,7 @@ impl<'a> Default for RadarrData<'a> {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Debug, Default, EnumIter)]
|
||||
#[cfg_attr(test, derive(Display, EnumString))]
|
||||
pub enum ActiveRadarrBlock {
|
||||
AddMovieAlreadyInLibrary,
|
||||
AddMovieSearchInput,
|
||||
|
||||
@@ -41,7 +41,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,7 +202,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}],
|
||||
@@ -231,7 +231,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}],
|
||||
@@ -319,7 +319,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}],
|
||||
@@ -348,7 +348,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}],
|
||||
|
||||
@@ -604,7 +604,7 @@ mod tests {
|
||||
Description: Blah blah blah
|
||||
TMDB: 99%
|
||||
IMDB: 9.9
|
||||
Rotten Tomatoes:
|
||||
Rotten Tomatoes: 99%
|
||||
Quality Profile: HD - 1080p
|
||||
Size: 3.30 GB
|
||||
Path: /nfs/movies
|
||||
@@ -921,7 +921,7 @@ mod tests {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}]);
|
||||
|
||||
@@ -22,12 +22,10 @@ mod root_folders;
|
||||
mod system;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "radarr_network_tests.rs"]
|
||||
mod radarr_network_tests;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "radarr_network_test_utils.rs"]
|
||||
mod radarr_network_test_utils;
|
||||
pub mod radarr_network_test_utils;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone)]
|
||||
pub enum RadarrEvent {
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#[cfg(test)]
|
||||
pub(in crate::network::radarr_network) mod test_utils {
|
||||
use crate::models::HorizontallyScrollableText;
|
||||
pub mod test_utils {
|
||||
use crate::models::radarr_models::{
|
||||
AddMovieSearchResult, BlocklistItem, BlocklistItemMovie, Collection, CollectionMovie, Credit,
|
||||
CreditType, DownloadRecord, DownloadsResponse, IndexerSettings, MediaInfo, MinimumAvailability,
|
||||
Movie, MovieCollection, MovieFile, MovieHistoryItem, RadarrRelease, Rating, RatingsList,
|
||||
Movie, MovieCollection, MovieFile, MovieHistoryItem, RadarrRelease, RadarrTask, RadarrTaskName,
|
||||
Rating, RatingsList,
|
||||
};
|
||||
use crate::models::servarr_data::modals::IndexerTestResultModalItem;
|
||||
use crate::models::servarr_models::{
|
||||
Indexer, IndexerField, Language, Quality, QualityWrapper, RootFolder,
|
||||
DiskSpace, Indexer, IndexerField, Language, Quality, QualityWrapper, QueueEvent, RootFolder,
|
||||
};
|
||||
use crate::models::{HorizontallyScrollableText, ScrollableText};
|
||||
use bimap::BiMap;
|
||||
use chrono::DateTime;
|
||||
use indoc::formatdoc;
|
||||
use serde_json::{Number, Value, json};
|
||||
|
||||
pub const MOVIE_JSON: &str = r#"{
|
||||
@@ -42,7 +46,7 @@ pub(in crate::network::radarr_network) mod test_utils {
|
||||
"value": 9.9
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
},
|
||||
"movieFile": {
|
||||
@@ -86,10 +90,10 @@ pub(in crate::network::radarr_network) mod test_utils {
|
||||
"value": 9.9
|
||||
},
|
||||
"tmdb": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
},
|
||||
"rottenTomatoes": {
|
||||
"value": 9.9
|
||||
"value": 99
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,6 +108,49 @@ pub(in crate::network::radarr_network) mod test_utils {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn diskspace() -> DiskSpace {
|
||||
DiskSpace {
|
||||
free_space: 6500,
|
||||
total_space: 8675309,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn log_line() -> &'static str {
|
||||
"2025-12-15 16:14:45 UTC|INFO|DownloadDecisionMaker|Processing 545 releases"
|
||||
}
|
||||
|
||||
pub fn task() -> RadarrTask {
|
||||
RadarrTask {
|
||||
name: "Backup".to_string(),
|
||||
task_name: RadarrTaskName::Backup,
|
||||
interval: 60,
|
||||
last_execution: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T21:29:16Z").unwrap()),
|
||||
last_duration: "00:00:17".to_string(),
|
||||
next_execution: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T22:29:16Z").unwrap()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn queued_event() -> QueueEvent {
|
||||
QueueEvent {
|
||||
trigger: "manual".to_string(),
|
||||
name: "Refresh Monitored Downloads".to_string(),
|
||||
command_name: "Refresh Monitored Downloads".to_string(),
|
||||
status: "completed".to_string(),
|
||||
queued: DateTime::from(DateTime::parse_from_rfc3339("2023-05-20T21:25:16Z").unwrap()),
|
||||
started: Some(DateTime::from(
|
||||
DateTime::parse_from_rfc3339("2023-05-20T21:25:30Z").unwrap(),
|
||||
)),
|
||||
ended: Some(DateTime::from(
|
||||
DateTime::parse_from_rfc3339("2023-05-20T21:28:33Z").unwrap(),
|
||||
)),
|
||||
duration: Some("00:03:03".to_owned()),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn tags_map() -> BiMap<i64, String> {
|
||||
BiMap::from_iter([(1, "alex".to_owned())])
|
||||
}
|
||||
|
||||
pub fn genres() -> Vec<String> {
|
||||
vec!["cool".to_owned(), "family".to_owned(), "fun".to_owned()]
|
||||
}
|
||||
@@ -114,11 +161,17 @@ pub(in crate::network::radarr_network) mod test_utils {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn percentage_rating() -> Rating {
|
||||
Rating {
|
||||
value: 99.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ratings_list() -> RatingsList {
|
||||
RatingsList {
|
||||
imdb: Some(rating()),
|
||||
tmdb: Some(rating()),
|
||||
rotten_tomatoes: Some(rating()),
|
||||
rotten_tomatoes: Some(percentage_rating()),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,4 +445,94 @@ pub(in crate::network::radarr_network) mod test_utils {
|
||||
"name": "HD - 1080p"
|
||||
})
|
||||
}
|
||||
|
||||
pub fn quality_profile_map() -> BiMap<i64, String> {
|
||||
let quality_profile = quality_profile();
|
||||
let id = quality_profile
|
||||
.get("id")
|
||||
.expect("A id must be set on a quality profile")
|
||||
.as_i64()
|
||||
.expect("'id' must be a string");
|
||||
let name = quality_profile
|
||||
.get("name")
|
||||
.expect("A name must be set on a quality profile")
|
||||
.as_str()
|
||||
.expect("'name' must be a string")
|
||||
.to_owned();
|
||||
|
||||
BiMap::from_iter(vec![(id, name)])
|
||||
}
|
||||
|
||||
pub fn updates() -> ScrollableText {
|
||||
let line_break = "-".repeat(200);
|
||||
ScrollableText::with_string(formatdoc!(
|
||||
"
|
||||
The latest version of Radarr is already installed
|
||||
|
||||
4.3.2.1 - 2023-04-15 02:02:53 UTC (Currently Installed)
|
||||
{line_break}
|
||||
New:
|
||||
* Cool new thing
|
||||
Fixed:
|
||||
* Some bugs killed
|
||||
|
||||
|
||||
3.2.1.0 - 2023-04-15 02:02:53 UTC (Previously Installed)
|
||||
{line_break}
|
||||
New:
|
||||
* Cool new thing (old)
|
||||
* Other cool new thing (old)
|
||||
|
||||
|
||||
2.1.0 - 2023-04-15 02:02:53 UTC
|
||||
{line_break}
|
||||
Fixed:
|
||||
* Killed bug 1
|
||||
* Fixed bug 2"
|
||||
))
|
||||
}
|
||||
|
||||
pub fn indexer_test_result() -> IndexerTestResultModalItem {
|
||||
IndexerTestResultModalItem {
|
||||
name: "DrunkenSlug".to_owned(),
|
||||
is_valid: false,
|
||||
validation_failures: "Some failure".into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn torrent_release() -> RadarrRelease {
|
||||
RadarrRelease {
|
||||
guid: "1234".to_string(),
|
||||
protocol: "torrent".to_string(),
|
||||
age: 12,
|
||||
title: "Some movie release".into(),
|
||||
indexer: "The Pirate Bay".to_string(),
|
||||
indexer_id: 1,
|
||||
size: 2468,
|
||||
rejected: true,
|
||||
rejections: Some(vec!["something interesting".into()]),
|
||||
seeders: Some(25.into()),
|
||||
leechers: Some(3.into()),
|
||||
languages: Some(vec![language()]),
|
||||
quality: quality_wrapper(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn usenet_release() -> RadarrRelease {
|
||||
RadarrRelease {
|
||||
guid: "1234".to_string(),
|
||||
protocol: "usenet".to_string(),
|
||||
age: 22,
|
||||
title: "Some Other movie release".into(),
|
||||
indexer: "The Pirate Bay".to_string(),
|
||||
indexer_id: 2,
|
||||
size: 1512,
|
||||
rejected: true,
|
||||
rejections: Some(vec!["Bad stuff happens in the middle of nowhere".into()]),
|
||||
seeders: None,
|
||||
leechers: None,
|
||||
languages: Some(vec![language()]),
|
||||
quality: quality_wrapper(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,9 +185,9 @@ impl Network<'_, '_> {
|
||||
.map(|update| {
|
||||
let install_status = if update.installed_on.is_some() {
|
||||
if update.installed {
|
||||
"(Currently Installed)".to_owned()
|
||||
" (Currently Installed)".to_owned()
|
||||
} else {
|
||||
"(Previously Installed)".to_owned()
|
||||
" (Previously Installed)".to_owned()
|
||||
}
|
||||
} else {
|
||||
String::new()
|
||||
@@ -201,7 +201,7 @@ impl Network<'_, '_> {
|
||||
};
|
||||
|
||||
let mut update_info = formatdoc!(
|
||||
"{} - {} {install_status}
|
||||
"{} - {}{install_status}
|
||||
{}",
|
||||
update.version,
|
||||
update.release_date,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::models::HorizontallyScrollableText;
|
||||
use crate::models::radarr_models::{RadarrSerdeable, RadarrTask, RadarrTaskName, SystemStatus};
|
||||
use crate::models::servarr_models::{
|
||||
DiskSpace, HostConfig, LogResponse, QueueEvent, SecurityConfig, Update,
|
||||
};
|
||||
use crate::models::{HorizontallyScrollableText, ScrollableText};
|
||||
use crate::network::network_tests::test_utils::{MockServarrApi, test_network};
|
||||
use crate::network::radarr_network::RadarrEvent;
|
||||
use crate::network::radarr_network::radarr_network_test_utils::test_utils::updates;
|
||||
use chrono::DateTime;
|
||||
use indoc::formatdoc;
|
||||
use pretty_assertions::{assert_eq, assert_str_eq};
|
||||
use serde_json::json;
|
||||
|
||||
@@ -297,32 +297,7 @@ mod tests {
|
||||
},
|
||||
}]);
|
||||
let response: Vec<Update> = serde_json::from_value(updates_json.clone()).unwrap();
|
||||
let line_break = "-".repeat(200);
|
||||
let expected_text = ScrollableText::with_string(formatdoc!(
|
||||
"
|
||||
The latest version of Radarr is already installed
|
||||
|
||||
4.3.2.1 - 2023-04-15 02:02:53 UTC (Currently Installed)
|
||||
{line_break}
|
||||
New:
|
||||
* Cool new thing
|
||||
Fixed:
|
||||
* Some bugs killed
|
||||
|
||||
|
||||
3.2.1.0 - 2023-04-15 02:02:53 UTC (Previously Installed)
|
||||
{line_break}
|
||||
New:
|
||||
* Cool new thing (old)
|
||||
* Other cool new thing (old)
|
||||
|
||||
|
||||
2.1.0 - 2023-04-15 02:02:53 UTC
|
||||
{line_break}
|
||||
Fixed:
|
||||
* Killed bug 1
|
||||
* Fixed bug 2"
|
||||
));
|
||||
let expected_text = updates();
|
||||
let (async_server, app, _server) = MockServarrApi::get()
|
||||
.returns(updates_json)
|
||||
.build_for(RadarrEvent::GetUpdates)
|
||||
|
||||
@@ -35,6 +35,8 @@ pub mod theme;
|
||||
mod ui_property_tests;
|
||||
#[cfg(test)]
|
||||
pub mod ui_test_utils;
|
||||
#[cfg(test)]
|
||||
mod ui_tests;
|
||||
mod utils;
|
||||
mod widgets;
|
||||
|
||||
|
||||
@@ -3,9 +3,7 @@ mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::radarr_models::BlocklistItem;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, BLOCKLIST_BLOCKS};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::blocklist::BlocklistUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
@@ -21,54 +19,54 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_blocklist_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Blocklist.into());
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use crate::ui::ui_test_utils::test_utils::TerminalSize;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
use super::*;
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
#[test]
|
||||
fn test_blocklist_ui_renders_blocklist_tab_loading() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Blocklist.into());
|
||||
|
||||
#[test]
|
||||
fn test_blocklist_ui_renders_empty_blocklist() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Blocklist.into());
|
||||
app.data.radarr_data.blocklist = StatefulTable::default();
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
#[test]
|
||||
fn test_blocklist_ui_renders_empty_blocklist() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Blocklist.into());
|
||||
|
||||
#[test]
|
||||
fn test_blocklist_ui_renders_with_blocklist_items() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Blocklist.into());
|
||||
app.data.radarr_data.blocklist = StatefulTable::default();
|
||||
app.data.radarr_data.blocklist.set_items(vec![
|
||||
BlocklistItem {
|
||||
id: 1,
|
||||
source_title: "Test.Movie.2023.1080p".to_owned(),
|
||||
..BlocklistItem::default()
|
||||
},
|
||||
BlocklistItem {
|
||||
id: 2,
|
||||
source_title: "Another.Movie.2023.720p".to_owned(),
|
||||
..BlocklistItem::default()
|
||||
},
|
||||
]);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
#[rstest]
|
||||
fn test_blocklist_ui_renders_blocklist_tab(
|
||||
#[values(
|
||||
ActiveRadarrBlock::Blocklist,
|
||||
ActiveRadarrBlock::BlocklistSortPrompt,
|
||||
ActiveRadarrBlock::DeleteBlocklistItemPrompt,
|
||||
ActiveRadarrBlock::BlocklistClearAllItemsPrompt,
|
||||
)] active_radarr_block: ActiveRadarrBlock
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
BlocklistUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Movie Title Source Title Languages Quality Formats Date
|
||||
=> Test.Movie.2023.1080p 1970-01-01 00:00:0
|
||||
Another.Movie.2023.720p 1970-01-01 00:00:0
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Movie Title ▼ Source Title Languages Quality Formats Date
|
||||
=> Test z movie English HD - 1080p English 2024-02-10 07:28:45 UTC
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Movie Title ▼ Source Title Languages Quality Formats Date
|
||||
=> Test z movie English HD - 1080p English 2024-02-10 07:28:45 UTC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭────── Clear Blocklist ──────╮
|
||||
│ Do you want to clear your │
|
||||
│ blocklist? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭──────────────╮╭─────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰──────────────╯╰─────────────╯│
|
||||
╰───────────────────────────────╯
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Movie Title Source Title Languages Quality Formats Date
|
||||
=> Test z movie English HD - 1080p English 2024-02-10 07:28:45 UTC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────╮
|
||||
│Something │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰───────────────────────────────╯
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Movie Title ▼ Source Title Languages Quality Formats Date
|
||||
=> Test z movie English HD - 1080p English 2024-02-10 07:28:45 UTC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭────────────── Remove Item from Blocklist ───────────────╮
|
||||
│ Do you want to remove this item from your blocklist: │
|
||||
│ z movie? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
source: src/ui/radarr_ui/blocklist/blocklist_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
@@ -100,7 +100,7 @@ pub fn draw_collection_details(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
|
||||
.unwrap_or_default()
|
||||
.value
|
||||
.as_f64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
let rotten_tomatoes_rating = movie
|
||||
.ratings
|
||||
.rotten_tomatoes
|
||||
@@ -108,7 +108,7 @@ pub fn draw_collection_details(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect)
|
||||
.unwrap_or_default()
|
||||
.value
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
let imdb_rating = if imdb_rating == 0.0 {
|
||||
String::new()
|
||||
} else {
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::radarr_models::{Collection, CollectionMovie};
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, COLLECTION_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::collections::collection_details_ui::CollectionDetailsUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_collection_details_ui_accepts() {
|
||||
@@ -39,27 +36,39 @@ mod tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_collection_details_ui_renders_collection_details() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::CollectionDetails.into());
|
||||
app.data.radarr_data.quality_profile_map = BiMap::from_iter(vec![(1, "HD - 1080p".to_owned())]);
|
||||
app.data.radarr_data.collections = StatefulTable::default();
|
||||
app.data.radarr_data.collections.set_items(vec![Collection {
|
||||
id: 1,
|
||||
title: "Test Collection".into(),
|
||||
quality_profile_id: 1,
|
||||
movies: Some(vec![CollectionMovie {
|
||||
title: "Movie 1".into(),
|
||||
..CollectionMovie::default()
|
||||
}]),
|
||||
..Collection::default()
|
||||
}]);
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
CollectionDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
fn test_collection_details_ui_renders_collection_details(
|
||||
#[values(
|
||||
ActiveRadarrBlock::CollectionDetails,
|
||||
ActiveRadarrBlock::ViewMovieOverview
|
||||
)] active_radarr_block: ActiveRadarrBlock
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_collection_details_ui_renders_collection_details_empty() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.collection_movies = StatefulTable::default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::CollectionDetails.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@ mod tests {
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::collections::CollectionsUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_collections_ui_accepts() {
|
||||
@@ -28,29 +28,95 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_collections_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
|
||||
mod snapshot_tests {
|
||||
use super::*;
|
||||
use rstest::rstest;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::radarr::radarr_data::EDIT_COLLECTION_SELECTION_BLOCKS;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
#[case(true, false, false)]
|
||||
#[case(false, true, false)]
|
||||
#[case(false, false, true)]
|
||||
fn test_radarr_ui_renders_collections_tab_loading(
|
||||
#[case] is_loading: bool,
|
||||
#[case] empty_movies: bool,
|
||||
#[case] empty_profile_map: bool,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
|
||||
app.is_loading = is_loading;
|
||||
if empty_movies {
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
}
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
if empty_profile_map {
|
||||
app.data.radarr_data.quality_profile_map = Default::default();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_collections_ui_renders_empty_collections() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
|
||||
app.data.radarr_data.collections = StatefulTable::default();
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
#[rstest]
|
||||
fn test_radarr_ui_renders_collections_tab(
|
||||
#[values(
|
||||
ActiveRadarrBlock::Collections,
|
||||
ActiveRadarrBlock::CollectionsSortPrompt,
|
||||
ActiveRadarrBlock::FilterCollections,
|
||||
ActiveRadarrBlock::FilterCollectionsError,
|
||||
ActiveRadarrBlock::SearchCollection,
|
||||
ActiveRadarrBlock::SearchCollectionError,
|
||||
ActiveRadarrBlock::UpdateAllCollectionsPrompt,
|
||||
)] active_radarr_block: ActiveRadarrBlock) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_radarr_ui_renders_collections_tab_empty() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.collections = StatefulTable::default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Collections.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionPrompt)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionConfirmPrompt)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionRootFolderPathInput)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionSelectMinimumAvailability)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionSelectQualityProfile)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionToggleSearchOnAdd)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionToggleMonitored)]
|
||||
fn test_edit_collection_ui_renders_edit_collection_modal(
|
||||
#[case] context_block: ActiveRadarrBlock,
|
||||
#[case] active_radarr_block: ActiveRadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack((active_radarr_block, Some(context_block)).into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_COLLECTION_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
CollectionsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(format!("{}_{}", active_radarr_block.to_string(), context_block.to_string()), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::radarr_models::Collection;
|
||||
use crate::models::servarr_data::radarr::modals::EditCollectionModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, EDIT_COLLECTION_BLOCKS, EDIT_COLLECTION_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::collections::edit_collection_ui::EditCollectionUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_edit_collection_ui_accepts() {
|
||||
@@ -34,28 +30,39 @@ mod tests {
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_collection_ui_renders_edit_collection_modal() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditCollectionRootFolderPathInput.into());
|
||||
app.data.radarr_data.quality_profile_map = BiMap::from_iter(vec![(1, "HD - 1080p".to_owned())]);
|
||||
app.data.radarr_data.collections = StatefulTable::default();
|
||||
app.data.radarr_data.collections.set_items(vec![Collection {
|
||||
id: 1,
|
||||
title: "Test Collection".into(),
|
||||
quality_profile_id: 1,
|
||||
root_folder_path: Some("/movies".to_owned()),
|
||||
..Collection::default()
|
||||
}]);
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_COLLECTION_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.edit_collection_modal =
|
||||
Some(EditCollectionModal::from(&app.data.radarr_data));
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
EditCollectionUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionPrompt)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionConfirmPrompt)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionRootFolderPathInput)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionSelectMinimumAvailability)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionSelectQualityProfile)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionToggleSearchOnAdd)]
|
||||
#[case(ActiveRadarrBlock::Collections, ActiveRadarrBlock::EditCollectionToggleMonitored)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionPrompt)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionConfirmPrompt)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionRootFolderPathInput)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionSelectMinimumAvailability)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionSelectQualityProfile)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionToggleSearchOnAdd)]
|
||||
#[case(ActiveRadarrBlock::CollectionDetails, ActiveRadarrBlock::EditCollectionToggleMonitored)]
|
||||
fn test_edit_collection_ui_renders_edit_collection_modal(
|
||||
#[case] active_radarr_block: ActiveRadarrBlock,
|
||||
#[case] context_block: ActiveRadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack((active_radarr_block, Some(context_block)).into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_COLLECTION_SELECTION_BLOCKS);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditCollectionUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(format!("{}_{}", active_radarr_block.to_string(), context_block.to_string()), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collection_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ─────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: │
|
||||
│Root Folder Path: │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Availability: Announced │
|
||||
│Monitored: No │
|
||||
│ Movies ──────────────────────────────────────────────────────────────────────────────│
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collection_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Availability: Released │
|
||||
│Monitored: Yes │
|
||||
│Search on Add: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ Movies ────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ ✔ Title Year Runtime IMDB Rating Rotten Tomatoes Rating Genres │
|
||||
│=> ✔ Test 2023 2h 0m 9.9 99% cool, family, fun │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collection_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Availability: Released │
|
||||
│Monitored: Yes │
|
||||
│Search on Add: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭ Overview ────────────────────────────────────────────────────╮ │
|
||||
│ Movies ───────────────────│Collection blah blah blah │───────────────────────────│
|
||||
│ ✔ Title │ │ │
|
||||
│=> ✔ Test │ │family, fun │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ ╰────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collection_details_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Availability: Released │
|
||||
│Monitored: Yes │
|
||||
│Search on Add: Yes │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ Movies ────────────────────────────────────────────────────────────────────────────────────────────────────────────────│
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────╮
|
||||
│Something │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰───────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ Monitored: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs/movies │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│ │ Search on Add: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ Monitored: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs/movies │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│ │ Search on Add: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ Monitored: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs/movies │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│ │ Search on Add: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ ╭───────────────────────────────╮ │ │
|
||||
│ │ │Announced │ │ │
|
||||
│ │ │In Cinemas │───────────────────────────╮ │ │
|
||||
│ │ Minimum│Released │ ▼ │ │ │
|
||||
│ │ │TBA │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ Qu│ │ ▼ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ ╰───────────────────────────────╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ ╭───────────────────────────────╮ │ │
|
||||
│ │ │HD - 1080p │ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ Minimum│ │ ▼ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ Qu│ │ ▼ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ │ │ │ │
|
||||
│ │ ╰───────────────────────────────╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ Monitored: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs/movies │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│ │ Search on Add: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭───╮ │ │
|
||||
│=> ✔ Test │ Monitored: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs/movies │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭───╮ │ │
|
||||
│ │ Search on Add: │ ✔ │ │ │
|
||||
│ │ ╰───╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Save ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────── Filter ──────────────────╮
|
||||
│Something │
|
||||
╰─────────────────────────────────────────────╯
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────── Error ───────────────╮
|
||||
│The given filter produced empty results│
|
||||
│ │
|
||||
╰───────────────────────────────────────╯
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────── Search ──────────────────╮
|
||||
│Something │
|
||||
╰─────────────────────────────────────────────╯
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────── Error ───────────────╮
|
||||
│ No items found matching search │
|
||||
│ │
|
||||
╰───────────────────────────────────────╯
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────── Update All Collections ─────────────────╮
|
||||
│ Do you want to update all of your collections? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/collections_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭────────────────────── Edit - Test Collection ──────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: ╰───╯ │
|
||||
│ ╭───────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰───────────────────────────────╯ │
|
||||
│ ╭───────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰───────────────────────────────╯ │
|
||||
│ ╭───────────────────────────────╮ │
|
||||
│ Root Folder: ╰───────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ │ │
|
||||
│ ╰───╯ │
|
||||
╰──────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/collections/edit_collection_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────── Edit - Test Collection ────────────────────────────────────╮
|
||||
│ Collection blah blah blah │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───╮ │
|
||||
│ Monitored: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Minimum Availability: │Announced ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Quality Profile: │HD - 1080p ▼ │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭────────────────────────────────────────────╮ │
|
||||
│ Root Folder: │/nfs/movies │ │
|
||||
│ ╰────────────────────────────────────────────╯ │
|
||||
│ ╭───╮ │
|
||||
│ Search on Add: │ ✔ │ │
|
||||
│ ╰───╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│
|
||||
││ Save ││ Cancel ││
|
||||
│╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
@@ -3,12 +3,10 @@ mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::radarr_models::DownloadRecord;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, DOWNLOADS_BLOCKS};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::downloads::DownloadsUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_downloads_ui_accepts() {
|
||||
@@ -21,62 +19,51 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_downloads_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Downloads.into());
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_radarr_ui_renders_downloads_tab_loading() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Downloads.into());
|
||||
app.is_loading = true;
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_downloads_ui_renders_empty_downloads() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Downloads.into());
|
||||
app.data.radarr_data.downloads = StatefulTable::default();
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
fn test_radarr_ui_renders_downloads_tab(
|
||||
#[values(
|
||||
ActiveRadarrBlock::Downloads,
|
||||
ActiveRadarrBlock::DeleteDownloadPrompt,
|
||||
ActiveRadarrBlock::UpdateDownloadsPrompt,
|
||||
)] active_radarr_block: ActiveRadarrBlock
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_downloads_ui_renders_with_downloads() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Downloads.into());
|
||||
app.data.radarr_data.downloads = StatefulTable::default();
|
||||
app.data.radarr_data.downloads.set_items(vec![
|
||||
DownloadRecord {
|
||||
id: 1,
|
||||
movie_id: 1,
|
||||
title: "Test Movie Download".to_owned(),
|
||||
status: "downloading".to_owned(),
|
||||
size: 1024 * 1024 * 1024,
|
||||
sizeleft: 512 * 1024 * 1024,
|
||||
..DownloadRecord::default()
|
||||
},
|
||||
DownloadRecord {
|
||||
id: 2,
|
||||
movie_id: 2,
|
||||
title: "Another Movie Download".to_owned(),
|
||||
status: "completed".to_owned(),
|
||||
size: 2048 * 1024 * 1024,
|
||||
sizeleft: 0,
|
||||
..DownloadRecord::default()
|
||||
},
|
||||
]);
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_radarr_ui_renders_downloads_tab_empty() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Downloads.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
DownloadsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Title Percent Compl Size Output Path Indexer Download Client
|
||||
=> Test Movie Download 50% 1.00 GB
|
||||
Another Movie Download 100% 2.00 GB
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Title Percent Complete Size Output Path Indexer Download Client
|
||||
=> Test Download Title 50% 3.30 GB /nfs/movies/Test kickass torrents transmission
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────── Cancel Download ────────────────────╮
|
||||
│ Do you really want to delete this download: │
|
||||
│ Test Download Title? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Title Percent Complete Size Output Path Indexer Download Client
|
||||
=> Test Download Title 50% 3.30 GB /nfs/movies/Test kickass torrents transmission
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Title Percent Complete Size Output Path Indexer Download Client
|
||||
=> Test Download Title 50% 3.30 GB /nfs/movies/Test kickass torrents transmission
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────── Update Downloads ────────────────────╮
|
||||
│ Do you want to update your downloads? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: src/ui/radarr_ui/downloads/downloads_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
@@ -4,16 +4,13 @@ mod tests {
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::modals::EditIndexerModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, EDIT_INDEXER_BLOCKS, EDIT_INDEXER_TORRENT_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::models::servarr_models::{Indexer, IndexerField};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::models::servarr_models::{Indexer};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::indexers::edit_indexer_ui::EditIndexerUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use serde_json::json;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_edit_indexer_ui_accepts() {
|
||||
@@ -26,40 +23,41 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_indexer_ui_renders_edit_indexer_modal() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditIndexerNameInput.into());
|
||||
app.data.radarr_data.indexers = StatefulTable::default();
|
||||
app.data.radarr_data.indexers.set_items(vec![Indexer {
|
||||
id: 1,
|
||||
name: Some("Test Indexer".to_owned()),
|
||||
enable_rss: true,
|
||||
priority: 25,
|
||||
fields: Some(vec![
|
||||
IndexerField {
|
||||
name: Some("baseUrl".to_owned()),
|
||||
value: Some(json!("https://test.indexer.com")),
|
||||
},
|
||||
IndexerField {
|
||||
name: Some("apiKey".to_owned()),
|
||||
value: Some(json!("test-api-key")),
|
||||
},
|
||||
IndexerField {
|
||||
name: Some("seedCriteria.seedRatio".to_owned()),
|
||||
value: Some(json!(1.0)),
|
||||
},
|
||||
]),
|
||||
..Indexer::default()
|
||||
}]);
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_INDEXER_TORRENT_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.edit_indexer_modal = Some(EditIndexerModal::from(&app.data.radarr_data));
|
||||
mod snapshot_tests {
|
||||
use crate::models::servarr_data::radarr::radarr_data::EDIT_INDEXER_NZB_SELECTION_BLOCKS;
|
||||
use crate::network::radarr_network::radarr_network_test_utils::test_utils::indexer;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
EditIndexerUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_edit_indexer_ui_renders_edit_indexer_modal_torrent() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_INDEXER_TORRENT_SELECTION_BLOCKS);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditIndexerPrompt.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditIndexerUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_indexer_ui_renders_edit_indexer_modal_usenet() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.indexers.set_items(vec![Indexer {
|
||||
protocol: "usenet".to_owned(),
|
||||
..indexer()
|
||||
}]);
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(EDIT_INDEXER_NZB_SELECTION_BLOCKS);
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditIndexerPrompt.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditIndexerUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,13 +4,12 @@ mod tests {
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::radarr_models::IndexerSettings;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, INDEXER_SETTINGS_BLOCKS, INDEXER_SETTINGS_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::indexers::indexer_settings_ui::IndexerSettingsUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_indexer_settings_ui_accepts() {
|
||||
@@ -23,18 +22,20 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexer_settings_ui_renders_indexer_settings() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsMinimumAgeInput.into());
|
||||
app.data.radarr_data.selected_block =
|
||||
BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.indexer_settings = Some(IndexerSettings::default());
|
||||
mod snapshot_tests {
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
IndexerSettingsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_indexer_settings_ui_renders_indexer_settings() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::IndexerSettingsMinimumAgeInput.into());
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(INDEXER_SETTINGS_SELECTION_BLOCKS);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexerSettingsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,11 +6,10 @@ mod tests {
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, EDIT_INDEXER_BLOCKS, INDEXER_SETTINGS_BLOCKS, INDEXERS_BLOCKS,
|
||||
};
|
||||
use crate::models::servarr_models::Indexer;
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::indexers::IndexersUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_accepts() {
|
||||
@@ -29,59 +28,97 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
mod snapshot_tests {
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexers_tab_loading() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_empty_indexers() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.data.radarr_data.indexers = StatefulTable::default();
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexers_tab_empty_indexers() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.data.radarr_data.indexers = StatefulTable::default();
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_with_indexers() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
app.data.radarr_data.indexers = StatefulTable::default();
|
||||
app.data.radarr_data.indexers.set_items(vec![
|
||||
Indexer {
|
||||
id: 1,
|
||||
name: Some("Test Indexer 1".to_owned()),
|
||||
enable_rss: true,
|
||||
enable_automatic_search: true,
|
||||
enable_interactive_search: true,
|
||||
priority: 25,
|
||||
..Indexer::default()
|
||||
},
|
||||
Indexer {
|
||||
id: 2,
|
||||
name: Some("Test Indexer 2".to_owned()),
|
||||
enable_rss: false,
|
||||
..Indexer::default()
|
||||
},
|
||||
]);
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_indexers_tab() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Indexers.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_test_indexer_loading() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.indexer_test_errors = None;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::TestIndexer.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_test_indexer_success() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::TestIndexer.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_test_indexer_error() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::TestIndexer.into());
|
||||
|
||||
app.data.radarr_data.indexer_test_errors =
|
||||
Some("Connection timeout: Unable to reach indexer".to_owned());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_indexers_ui_renders_delete_indexer_prompt() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::DeleteIndexerPrompt.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
IndexersUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/edit_indexer_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────── Edit Indexer ─────────────────────────────────╮
|
||||
│ │
|
||||
│ ╭─────────────────╮ ╭─────────────────╮ │
|
||||
│ Name: ╰─────────────────╯ URL: ╰─────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────╮ │
|
||||
│ ╭───╮ API Key: ╰─────────────────╯ │
|
||||
│ Enable Automatic Se╰───╯ ╭─────────────────╮ │
|
||||
│ ╭───╮ Tags: ╰─────────────────╯ │
|
||||
│ ╭─────────────────╮ │
|
||||
│ Indexer Priority ▴▾╰─────────────────╯ │
|
||||
│ │
|
||||
│ ╭──────────────────╮╭───────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰──────────────────╯╰───────────────────╯ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────╯
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/edit_indexer_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────────────────────────────────── Edit Indexer ─────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ ╭─────────────────────────╮ ╭─────────────────────────╮ │
|
||||
│ Name: │DrunkenSlug │ URL: │http://127.0.0.1:9696/1/ │ │
|
||||
│ ╰─────────────────────────╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable RSS: │ ✔ │ API Key: │someApiKey │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable Automatic Search: │ ✔ │ Seed Ratio: │ratio │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable Interactive Search: │ ✔ │ Tags: │25 │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ ╭─────────────────────────╮ │
|
||||
│ Indexer Priority ▴▾: │1 │ │
|
||||
│ ╰─────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───────────────────────────╮╭──────────────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰───────────────────────────╯╰──────────────────────────╯ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/edit_indexer_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────────────────────────────────── Edit Indexer ─────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ ╭─────────────────────────╮ ╭─────────────────────────╮ │
|
||||
│ Name: │DrunkenSlug │ URL: │http://127.0.0.1:9696/1/ │ │
|
||||
│ ╰─────────────────────────╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable RSS: │ ✔ │ API Key: │someApiKey │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable Automatic Search: │ ✔ │ Tags: │25 │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ ╭───╮ ╭─────────────────────────╮ │
|
||||
│ Enable Interactive Search: │ ✔ │ Indexer Priority ▴▾: │1 │ │
|
||||
│ ╰───╯ ╰─────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭───────────────────────────╮╭──────────────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰───────────────────────────╯╰──────────────────────────╯ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/indexer_settings_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────────── Configure All Indexer Settings ────────────────────────╮
|
||||
│ │
|
||||
│ ╭─────────────────╮ ╭─────────────────╮ │
|
||||
│ Minimum Age (minute╰─────────────────╯ Availability Delay ╰─────────────────╯ │
|
||||
│ ╭─────────────────╮ ╭─────────────────╮ │
|
||||
│ Retention (days) ▴▾╰─────────────────╯ RSS Sync Interval (╰─────────────────╯ │
|
||||
│ ╭─────────────────╮ ╭─────────────────╮ │
|
||||
│ Maximum Size (MB) ▴╰─────────────────╯ Whitelisted Subtitl╰─────────────────╯ │
|
||||
│ ╭───╮ ╭───╮ │
|
||||
│ Prefer Indexer Flag╰───╯ Allow Hardcoded Sub╰───╯ │
|
||||
│ │
|
||||
│ ╭──────────────────╮╭───────────────────╮ │
|
||||
│ │ Save ││ Cancel │ │
|
||||
│ ╰──────────────────╯╰───────────────────╯ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────╯
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/indexers/indexer_settings_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────────────────────────────── 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 │ │
|
||||
│ ╰───────────────────────────╯╰──────────────────────────╯ │
|
||||
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_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
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────── Delete Indexer ─────────────────────╮
|
||||
│ Do you really want to delete this indexer: │
|
||||
│ Test Indexer? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
---
|
||||
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
|
||||
+1
-1
@@ -2,4 +2,4 @@
|
||||
source: src/ui/radarr_ui/indexers/indexers_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
source: src/ui/radarr_ui/indexers/indexers_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
Loading ...
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
---
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────── Error ───────────────╮
|
||||
│ Connection timeout: Unable to reach │
|
||||
│ indexer │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰───────────────────────────────────────╯
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
---
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭ Testing Indexer ────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ Loading ... │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰───────────────────────────────────────╯
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
---
|
||||
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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭─────────────── Error ───────────────╮
|
||||
│ error │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰───────────────────────────────────────╯
|
||||
+40
-22
@@ -6,25 +6,43 @@ 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(ActiveRadarrBlock::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());
|
||||
});
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ fn draw_add_movie_search(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
.unwrap_or_default()
|
||||
.value
|
||||
.as_f64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
let rotten_tomatoes_rating = movie
|
||||
.ratings
|
||||
.rotten_tomatoes
|
||||
@@ -112,7 +112,7 @@ fn draw_add_movie_search(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
.unwrap_or_default()
|
||||
.value
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
let imdb_rating = if imdb_rating == 0.0 {
|
||||
String::new()
|
||||
} else {
|
||||
|
||||
@@ -3,11 +3,10 @@ mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::HorizontallyScrollableText;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ADD_MOVIE_BLOCKS, ActiveRadarrBlock};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::library::add_movie_ui::AddMovieUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_add_movie_ui_accepts() {
|
||||
@@ -20,30 +19,59 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_add_movie_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AddMovieSearchInput.into());
|
||||
app.data.radarr_data.add_movie_search = Some(HorizontallyScrollableText::default());
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::radarr::radarr_data::ADD_MOVIE_SELECTION_BLOCKS;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
AddMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_add_movie_ui_renders_loading_for_search() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.data.radarr_data.add_searched_movies = None;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AddMovieSearchResults.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AddMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_add_movie_ui_renders_search_input() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::AddMovieSearchInput.into());
|
||||
app.data.radarr_data.add_movie_search = Some(HorizontallyScrollableText::default());
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
AddMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
#[case(ActiveRadarrBlock::AddMovieSearchInput, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieSearchResults, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieEmptySearchResults, None)]
|
||||
#[case(ActiveRadarrBlock::AddMoviePrompt, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectMinimumAvailability, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectMonitor, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectQualityProfile, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectRootFolder, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieAlreadyInLibrary, None)]
|
||||
#[case(ActiveRadarrBlock::AddMovieTagsInput, None)]
|
||||
#[case(ActiveRadarrBlock::AddMoviePrompt, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectMinimumAvailability, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectMonitor, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectQualityProfile, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
#[case(ActiveRadarrBlock::AddMovieSelectRootFolder, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
#[case(ActiveRadarrBlock::AddMovieTagsInput, Some(ActiveRadarrBlock::CollectionDetails))]
|
||||
fn test_add_movie_ui_renders(
|
||||
#[case] active_radarr_block: ActiveRadarrBlock,
|
||||
#[case] context: Option<ActiveRadarrBlock>
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack((active_radarr_block, context).into());
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(ADD_MOVIE_SELECTION_BLOCKS);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
AddMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
if let Some(context) = context {
|
||||
insta::assert_snapshot!(format!("{}_{}", active_radarr_block.to_string(), context.to_string()), output);
|
||||
} else {
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,15 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::radarr_models::Movie;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, DELETE_MOVIE_BLOCKS, DELETE_MOVIE_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::library::delete_movie_ui::DeleteMovieUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_delete_movie_ui_accepts() {
|
||||
@@ -25,24 +22,20 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_delete_movie_ui_renders_delete_movie_prompt() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::DeleteMoviePrompt.into());
|
||||
app.data.radarr_data.quality_profile_map = BiMap::from_iter(vec![(0, "Any".to_owned())]);
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(DELETE_MOVIE_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
app.data.radarr_data.movies.set_items(vec![Movie {
|
||||
id: 1,
|
||||
title: "Test Movie".into(),
|
||||
quality_profile_id: 0,
|
||||
..Movie::default()
|
||||
}]);
|
||||
mod snapshot_tests {
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
DeleteMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
#[test]
|
||||
fn test_delete_movie_ui_renders_delete_movie_prompt() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::DeleteMoviePrompt.into());
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(DELETE_MOVIE_SELECTION_BLOCKS);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
DeleteMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::radarr_models::Movie;
|
||||
use crate::models::servarr_data::radarr::modals::EditMovieModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ActiveRadarrBlock, EDIT_MOVIE_BLOCKS, EDIT_MOVIE_SELECTION_BLOCKS,
|
||||
};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::library::edit_movie_ui::EditMovieUi;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_edit_movie_ui_accepts() {
|
||||
@@ -26,27 +22,39 @@ mod tests {
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_movie_ui_renders_edit_movie_modal() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditMoviePathInput.into());
|
||||
app.data.radarr_data.quality_profile_map =
|
||||
BiMap::from_iter(vec![(1, "HD - 1080p".to_owned()), (2, "Any".to_owned())]);
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(EDIT_MOVIE_SELECTION_BLOCKS);
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
app.data.radarr_data.movies.set_items(vec![Movie {
|
||||
id: 1,
|
||||
title: "Test Movie".into(),
|
||||
path: "/movies/test".into(),
|
||||
quality_profile_id: 1,
|
||||
..Movie::default()
|
||||
}]);
|
||||
app.data.radarr_data.edit_movie_modal = Some(EditMovieModal::from(&app.data.radarr_data));
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
EditMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, None, 0)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::MovieDetails), 0)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::MovieHistory), 1)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::FileInfo), 2)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::Cast), 3)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::Crew), 4)]
|
||||
#[case(ActiveRadarrBlock::EditMoviePrompt, Some(ActiveRadarrBlock::ManualSearch), 5)]
|
||||
fn test_edit_movie_ui_renders_edit_movie_modal(
|
||||
#[case] active_radarr_block: ActiveRadarrBlock,
|
||||
#[case] context: Option<ActiveRadarrBlock>,
|
||||
#[case] index: usize,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack((active_radarr_block, context).into());
|
||||
if context.is_some() {
|
||||
app.data.radarr_data.movie_info_tabs.set_index(index);
|
||||
}
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(EDIT_MOVIE_SELECTION_BLOCKS);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
EditMovieUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
if let Some(context) = context {
|
||||
insta::assert_snapshot!(format!("{}_{}", active_radarr_block.to_string(), context.to_string()), output);
|
||||
} else {
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,14 @@
|
||||
mod tests {
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{
|
||||
ADD_MOVIE_BLOCKS, ActiveRadarrBlock, DELETE_MOVIE_BLOCKS, EDIT_MOVIE_BLOCKS, LIBRARY_BLOCKS,
|
||||
MOVIE_DETAILS_BLOCKS,
|
||||
};
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::library::LibraryUi;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_accepts() {
|
||||
@@ -26,4 +28,97 @@ mod tests {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
mod snapshot_tests {
|
||||
use rstest::rstest;
|
||||
use crate::models::BlockSelectionState;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ADD_MOVIE_SELECTION_BLOCKS, EDIT_MOVIE_SELECTION_BLOCKS};
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_renders_library_tab_loading() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Movies.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_renders_library_tab_empty_movies() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::Movies.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_library_ui_renders_library_tab(
|
||||
#[values(
|
||||
ActiveRadarrBlock::Movies,
|
||||
ActiveRadarrBlock::MoviesSortPrompt,
|
||||
ActiveRadarrBlock::SearchMovie,
|
||||
ActiveRadarrBlock::SearchMovieError,
|
||||
ActiveRadarrBlock::FilterMovies,
|
||||
ActiveRadarrBlock::FilterMoviesError,
|
||||
ActiveRadarrBlock::UpdateAllMoviesPrompt,
|
||||
)] active_radarr_block: ActiveRadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
|
||||
#[rstest]
|
||||
fn test_library_movie_ui_renders_add_movie_ui(
|
||||
#[values(
|
||||
ActiveRadarrBlock::AddMovieSearchInput,
|
||||
ActiveRadarrBlock::AddMovieSearchResults,
|
||||
ActiveRadarrBlock::AddMovieEmptySearchResults,
|
||||
ActiveRadarrBlock::AddMoviePrompt,
|
||||
ActiveRadarrBlock::AddMovieSelectMinimumAvailability,
|
||||
ActiveRadarrBlock::AddMovieSelectMonitor,
|
||||
ActiveRadarrBlock::AddMovieSelectQualityProfile,
|
||||
ActiveRadarrBlock::AddMovieSelectRootFolder,
|
||||
ActiveRadarrBlock::AddMovieAlreadyInLibrary,
|
||||
ActiveRadarrBlock::AddMovieTagsInput,
|
||||
)] active_radarr_block: ActiveRadarrBlock,
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(ADD_MOVIE_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(active_radarr_block.to_string(), output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_edit_movie_ui_renders_edit_movie_modal() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::EditMoviePrompt.into());
|
||||
app.data.radarr_data.selected_block = BlockSelectionState::new(EDIT_MOVIE_SELECTION_BLOCKS);
|
||||
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
LibraryUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -409,12 +409,12 @@ fn draw_movie_releases(f: &mut Frame<'_>, app: &mut App<'_>, area: Rect) {
|
||||
.clone()
|
||||
.unwrap_or(Number::from(0u64))
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
let leechers = leechers
|
||||
.clone()
|
||||
.unwrap_or(Number::from(0u64))
|
||||
.as_u64()
|
||||
.unwrap();
|
||||
.unwrap_or_default();
|
||||
|
||||
decorate_peer_style(
|
||||
seeders,
|
||||
|
||||
@@ -1,22 +1,18 @@
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use bimap::BiMap;
|
||||
use pretty_assertions::assert_eq;
|
||||
use ratatui::style::Style;
|
||||
use rstest::rstest;
|
||||
use strum::IntoEnumIterator;
|
||||
|
||||
use crate::app::App;
|
||||
use crate::models::radarr_models::{Movie, RadarrRelease};
|
||||
use crate::models::servarr_data::radarr::modals::MovieDetailsModal;
|
||||
use crate::models::servarr_data::radarr::radarr_data::{ActiveRadarrBlock, MOVIE_DETAILS_BLOCKS};
|
||||
use crate::models::stateful_table::StatefulTable;
|
||||
use crate::ui::DrawUi;
|
||||
use crate::ui::radarr_ui::library::movie_details_ui::{
|
||||
MovieDetailsUi, style_from_download_status,
|
||||
};
|
||||
use crate::ui::styles::ManagarrStyle;
|
||||
use crate::ui::ui_test_utils::test_utils::render_to_string_with_app;
|
||||
use crate::ui::ui_test_utils::test_utils::{TerminalSize, render_to_string_with_app};
|
||||
|
||||
#[test]
|
||||
fn test_movie_details_ui_accepts() {
|
||||
@@ -49,98 +45,70 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_movie_details_ui_renders_loading_state() {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(ActiveRadarrBlock::MovieDetails.into());
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
mod snapshot_tests {
|
||||
use super::*;
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
#[case(ActiveRadarrBlock::MovieDetails, None, 0)]
|
||||
#[case(ActiveRadarrBlock::MovieDetails, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 0)]
|
||||
#[case(ActiveRadarrBlock::MovieDetails, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 0)]
|
||||
#[case(ActiveRadarrBlock::MovieHistory, None, 1)]
|
||||
#[case(ActiveRadarrBlock::MovieHistory, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 1)]
|
||||
#[case(ActiveRadarrBlock::MovieHistory, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 1)]
|
||||
#[case(ActiveRadarrBlock::FileInfo, None, 2)]
|
||||
#[case(ActiveRadarrBlock::FileInfo, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 2)]
|
||||
#[case(ActiveRadarrBlock::FileInfo, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 2)]
|
||||
#[case(ActiveRadarrBlock::Cast, None, 3)]
|
||||
#[case(ActiveRadarrBlock::Cast, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 3)]
|
||||
#[case(ActiveRadarrBlock::Cast, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 3)]
|
||||
#[case(ActiveRadarrBlock::Crew, None, 4)]
|
||||
#[case(ActiveRadarrBlock::Crew, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 4)]
|
||||
#[case(ActiveRadarrBlock::Crew, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 4)]
|
||||
#[case(ActiveRadarrBlock::ManualSearch, None, 5)]
|
||||
#[case(ActiveRadarrBlock::ManualSearch, Some(ActiveRadarrBlock::AutomaticallySearchMoviePrompt), 5)]
|
||||
#[case(ActiveRadarrBlock::ManualSearch, Some(ActiveRadarrBlock::UpdateAndScanPrompt), 5)]
|
||||
#[case(ActiveRadarrBlock::ManualSearchSortPrompt, None, 5)]
|
||||
#[case(ActiveRadarrBlock::ManualSearchConfirmPrompt, None, 5)]
|
||||
fn test_movie_details_ui_renders_movie_details_tab(
|
||||
#[case] active_radarr_block: ActiveRadarrBlock,
|
||||
#[case] context: Option<ActiveRadarrBlock>,
|
||||
#[case] index: usize
|
||||
) {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack((active_radarr_block, context).into());
|
||||
app.data.radarr_data.movie_info_tabs.set_index(index);
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_movie_details_ui_renders_movie_details_tab() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::MovieDetails.into());
|
||||
app.data.radarr_data.quality_profile_map =
|
||||
BiMap::from_iter(vec![(2222, "HD - 1080p".to_owned())]);
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
app.data.radarr_data.movies.set_items(vec![Movie {
|
||||
id: 1,
|
||||
title: "Test Movie".into(),
|
||||
..Movie::default()
|
||||
}]);
|
||||
if let Some(context) = context {
|
||||
insta::assert_snapshot!(format!("movie_details_render_{active_radarr_block}_{context}"), output);
|
||||
} else {
|
||||
insta::assert_snapshot!(format!("movie_details_render_{active_radarr_block}"), output);
|
||||
}
|
||||
}
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
#[rstest]
|
||||
fn test_movie_details_ui_renders_movie_details_tabs_loading(
|
||||
#[values(
|
||||
ActiveRadarrBlock::MovieDetails,
|
||||
ActiveRadarrBlock::MovieHistory,
|
||||
ActiveRadarrBlock::FileInfo,
|
||||
ActiveRadarrBlock::Cast,
|
||||
ActiveRadarrBlock::Crew,
|
||||
ActiveRadarrBlock::ManualSearch,
|
||||
)] active_radarr_block: ActiveRadarrBlock
|
||||
) {
|
||||
let mut app = App::test_default();
|
||||
app.is_loading = true;
|
||||
app.push_navigation_stack(active_radarr_block.into());
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
let output = render_to_string_with_app(TerminalSize::Large, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
#[test]
|
||||
fn test_movie_details_ui_renders_movie_history_tab() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::MovieDetails.into());
|
||||
app.data.radarr_data.quality_profile_map =
|
||||
BiMap::from_iter(vec![(2222, "HD - 1080p".to_owned())]);
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
app.data.radarr_data.movies.set_items(vec![Movie {
|
||||
id: 1,
|
||||
title: "Test Movie".into(),
|
||||
..Movie::default()
|
||||
}]);
|
||||
app.data.radarr_data.movie_info_tabs.set_index(1);
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_movie_details_ui_renders_manual_search_tab() {
|
||||
let mut app = App::test_default();
|
||||
app.push_navigation_stack(ActiveRadarrBlock::MovieDetails.into());
|
||||
app.data.radarr_data.quality_profile_map =
|
||||
BiMap::from_iter(vec![(2222, "HD - 1080p".to_owned())]);
|
||||
app.data.radarr_data.movies = StatefulTable::default();
|
||||
app.data.radarr_data.movies.set_items(vec![Movie {
|
||||
id: 1,
|
||||
title: "Test Movie".into(),
|
||||
..Movie::default()
|
||||
}]);
|
||||
app.data.radarr_data.movie_details_modal = Some(MovieDetailsModal::default());
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movie_details_modal
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.movie_releases = StatefulTable::default();
|
||||
app
|
||||
.data
|
||||
.radarr_data
|
||||
.movie_details_modal
|
||||
.as_mut()
|
||||
.unwrap()
|
||||
.movie_releases
|
||||
.set_items(vec![RadarrRelease {
|
||||
title: "Test Release".into(),
|
||||
..RadarrRelease::default()
|
||||
}]);
|
||||
app.data.radarr_data.movie_info_tabs.set_index(2);
|
||||
|
||||
let output = render_to_string_with_app(120, 30, &mut app, |f, app| {
|
||||
MovieDetailsUi::draw(f, app, f.area());
|
||||
});
|
||||
|
||||
insta::assert_snapshot!(output);
|
||||
insta::assert_snapshot!(format!("movie_details_loading_{active_radarr_block}"), output);
|
||||
}
|
||||
}
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────────────────────── Add Movie ─────────────────────────────────────╮
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭──────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭──────────────────────────────────── Add Movie ─────────────────────────────────────╮
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭──────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ✔ Title Year Runtime IMDB Rotten Tomatoes Genres │
|
||||
│=> ✔ Test 2023 2h 0m 9.9 99% cool, family, fun │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭─────────────── Error ───────────────╮ │
|
||||
│ │ This film is already in your library │ │
|
||||
│ │ │ │
|
||||
│ ╰───────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ ╭─────────────── Error ───────────────╮ │
|
||||
│ │ No movies found matching your query! │ │
|
||||
│ │ │ │
|
||||
│ ╰───────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭───────────╭────────────────────────────────────── Add Movie - Test ───────────────────────────────────────╮──────────╮
|
||||
│ ✔ Title│ New movie blah blah blah │ │
|
||||
│=> ✔ Test │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Root Folder: │/nfs ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Monitor: │Movie only ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Tags: │alex │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Add ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Collection ▼ Number of Movies Root Folder Path Quality Profile Search on Add Monitored
|
||||
=> Test Collection 1 /nfs/movies HD - 1080p Yes 🏷
|
||||
|
||||
|
||||
|
||||
╭ Test Collection ───────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│Overview: Collection blah blah blah │
|
||||
│Root Folder Path: /nfs/movies │
|
||||
│Quality Profile: HD - 1080p │
|
||||
│Minimum Avai╭────────────────────────────────────── Add Movie - Test ───────────────────────────────────────╮ │
|
||||
│Monitored: Y│ Collection blah blah blah │ │
|
||||
│Search on Ad│ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ Movies ──│ │───────────│
|
||||
│ ✔ Title │ ╭────────────────────────────────────────────╮ │ │
|
||||
│=> ✔ Test │ Root Folder: │/nfs ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Monitor: │Movie only ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Minimum Availability: │Announced ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Quality Profile: │HD - 1080p ▼ │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ Tags: │alex │ │ │
|
||||
│ │ ╰────────────────────────────────────────────╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Add ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
||||
│ ✔ Title Year Runtime IMDB Rotten Tomatoes Genres │
|
||||
│=> ✔ Test 2023 2h 0m 9.9 99% cool, family, fun │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
---
|
||||
source: src/ui/radarr_ui/library/add_movie_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭───────────────────────────────────────────────────── Add Movie ──────────────────────────────────────────────────────╮
|
||||
│test │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
╭───────────╭────────────────────────────────────── Add Movie - Test ───────────────────────────────────────╮──────────╮
|
||||
│ ✔ Title│ New movie blah blah blah │ │
|
||||
│=> ✔ Test │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ ╭────────────────────────────────────────────╮ │ │
|
||||
│ │ ╭───────────────────────────────╮ ▼ │ │ │
|
||||
│ │ │Announced │───────────────────────────╯ │ │
|
||||
│ │ │In Cinemas │───────────────────────────╮ │ │
|
||||
│ │ │Released │ ▼ │ │ │
|
||||
│ │ │TBA │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ Minimum│ │ ▼ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ Qu│ │ ▼ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ │ │───────────────────────────╮ │ │
|
||||
│ │ │ │ │ │ │
|
||||
│ │ │ │───────────────────────────╯ │ │
|
||||
│ │ ╰───────────────────────────────╯ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │ │ │
|
||||
│ │╭───────────────────────────────────────────────╮╭──────────────────────────────────────────────╮│ │
|
||||
│ ││ Add ││ Cancel ││ │
|
||||
│ │╰───────────────────────────────────────────────╯╰──────────────────────────────────────────────╯│ │
|
||||
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────╯ │
|
||||
│ │
|
||||
│ │
|
||||
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user