feat(handler): Wired in the blocklist handler to the main handlers
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
use blocklist::BlocklistHandler;
|
||||||
use downloads::DownloadsHandler;
|
use downloads::DownloadsHandler;
|
||||||
use library::LibraryHandler;
|
use library::LibraryHandler;
|
||||||
|
|
||||||
@@ -37,6 +38,9 @@ impl<'a, 'b> KeyEventHandler<'a, 'b, ActiveSonarrBlock> for SonarrHandler<'a, 'b
|
|||||||
_ if DownloadsHandler::accepts(self.active_sonarr_block) => {
|
_ if DownloadsHandler::accepts(self.active_sonarr_block) => {
|
||||||
DownloadsHandler::with(self.key, self.app, self.active_sonarr_block, self.context).handle()
|
DownloadsHandler::with(self.key, self.app, self.active_sonarr_block, self.context).handle()
|
||||||
}
|
}
|
||||||
|
_ if BlocklistHandler::accepts(self.active_sonarr_block) => {
|
||||||
|
BlocklistHandler::with(self.key, self.app, self.active_sonarr_block, self.context).handle()
|
||||||
|
}
|
||||||
_ => self.handle_key_event(),
|
_ => self.handle_key_event(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,4 +127,22 @@ mod tests {
|
|||||||
active_sonarr_block
|
active_sonarr_block
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[rstest]
|
||||||
|
fn test_delegates_blocklist_blocks_to_blocklist_handler(
|
||||||
|
#[values(
|
||||||
|
ActiveSonarrBlock::Blocklist,
|
||||||
|
ActiveSonarrBlock::BlocklistItemDetails,
|
||||||
|
ActiveSonarrBlock::DeleteBlocklistItemPrompt,
|
||||||
|
ActiveSonarrBlock::BlocklistClearAllItemsPrompt,
|
||||||
|
ActiveSonarrBlock::BlocklistSortPrompt
|
||||||
|
)]
|
||||||
|
active_sonarr_block: ActiveSonarrBlock,
|
||||||
|
) {
|
||||||
|
test_handler_delegation!(
|
||||||
|
SonarrHandler,
|
||||||
|
ActiveSonarrBlock::Blocklist,
|
||||||
|
active_sonarr_block
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user