feat(handlers): Support for root folder actions
This commit is contained in:
@@ -380,6 +380,12 @@ pub static HISTORY_BLOCKS: [ActiveSonarrBlock; 7] = [
|
||||
ActiveSonarrBlock::SearchHistoryError,
|
||||
];
|
||||
|
||||
pub static ROOT_FOLDERS_BLOCKS: [ActiveSonarrBlock; 3] = [
|
||||
ActiveSonarrBlock::RootFolders,
|
||||
ActiveSonarrBlock::AddRootFolderPrompt,
|
||||
ActiveSonarrBlock::DeleteRootFolderPrompt,
|
||||
];
|
||||
|
||||
impl From<ActiveSonarrBlock> for Route {
|
||||
fn from(active_sonarr_block: ActiveSonarrBlock) -> Route {
|
||||
Route::Sonarr(active_sonarr_block, None)
|
||||
|
||||
@@ -204,7 +204,7 @@ mod tests {
|
||||
use crate::models::servarr_data::sonarr::sonarr_data::{
|
||||
ActiveSonarrBlock, ADD_SERIES_BLOCKS, ADD_SERIES_SELECTION_BLOCKS, BLOCKLIST_BLOCKS,
|
||||
DELETE_SERIES_BLOCKS, DELETE_SERIES_SELECTION_BLOCKS, DOWNLOADS_BLOCKS, EDIT_SERIES_BLOCKS,
|
||||
EDIT_SERIES_SELECTION_BLOCKS, HISTORY_BLOCKS, LIBRARY_BLOCKS,
|
||||
EDIT_SERIES_SELECTION_BLOCKS, HISTORY_BLOCKS, LIBRARY_BLOCKS, ROOT_FOLDERS_BLOCKS,
|
||||
};
|
||||
|
||||
#[test]
|
||||
@@ -386,5 +386,13 @@ mod tests {
|
||||
assert!(HISTORY_BLOCKS.contains(&ActiveSonarrBlock::SearchHistory));
|
||||
assert!(HISTORY_BLOCKS.contains(&ActiveSonarrBlock::SearchHistoryError));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_root_folders_blocks_contents() {
|
||||
assert_eq!(ROOT_FOLDERS_BLOCKS.len(), 3);
|
||||
assert!(ROOT_FOLDERS_BLOCKS.contains(&ActiveSonarrBlock::RootFolders));
|
||||
assert!(ROOT_FOLDERS_BLOCKS.contains(&ActiveSonarrBlock::AddRootFolderPrompt));
|
||||
assert!(ROOT_FOLDERS_BLOCKS.contains(&ActiveSonarrBlock::DeleteRootFolderPrompt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user