fix(readarr): render the update all authors confirmation prompt
This commit is contained in:
3 files changed
+66
No files matched your search
@@ -237,6 +237,19 @@ mod tests {
|
||||
insta::assert_snapshot!(output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_library_ui_renders_update_all_authors_prompt() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
app.push_navigation_stack(ActiveReadarrBlock::Authors.into());
|
||||
app.push_navigation_stack(ActiveReadarrBlock::UpdateAllAuthorsPrompt.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_author_details_over_library() {
|
||||
let mut app = App::test_default_fully_populated();
|
||||
|
||||
@@ -6,6 +6,10 @@ use ratatui::{
|
||||
};
|
||||
|
||||
use crate::ui::widgets::managarr_table::ManagarrTable;
|
||||
use crate::ui::widgets::{
|
||||
confirmation_prompt::ConfirmationPrompt,
|
||||
popup::{Popup, Size},
|
||||
};
|
||||
use crate::utils::convert_to_gb;
|
||||
use crate::{
|
||||
app::App,
|
||||
@@ -44,6 +48,17 @@ impl DrawUi for LibraryUi {
|
||||
|
||||
match route {
|
||||
_ if AuthorDetailsUi::accepts(route) => AuthorDetailsUi::draw(f, app, area),
|
||||
Route::Readarr(ActiveReadarrBlock::UpdateAllAuthorsPrompt, _) => {
|
||||
let confirmation_prompt = ConfirmationPrompt::new()
|
||||
.title("Update All Authors")
|
||||
.prompt("Do you want to update info and scan your disks for all of your authors?")
|
||||
.yes_no_value(app.data.readarr_data.prompt_confirm);
|
||||
|
||||
f.render_widget(
|
||||
Popup::new(confirmation_prompt).size(Size::MediumPrompt),
|
||||
f.area(),
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
source: src/ui/readarr_ui/library/library_ui_tests.rs
|
||||
expression: output
|
||||
---
|
||||
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
||||
Name ▼ Status Quality Profile Metadata Profile Books Size Monitored Tags
|
||||
=> Test Author Continuing Standard Standard 0 0.00 GB 🏷 alex
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
╭────────────────── Update All Authors ───────────────────╮
|
||||
│ Do you want to update info and scan your disks for all of │
|
||||
│ your authors? │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│╭────────────────────────────╮╭───────────────────────────╮│
|
||||
││ Yes ││ No ││
|
||||
│╰────────────────────────────╯╰───────────────────────────╯│
|
||||
╰───────────────────────────────────────────────────────────╯
|
||||
Reference in new issue
Block a user