test(readarr): populate the book fixture with statistics

The shared Book fixture left statistics as None, so every author details
snapshot rendered the missing-statistics N/A cells and the populated
branch of the Files and Size columns was only exercised by one test.
Give the fixture distinct, non-default counts and a size that formats to
a value different from the dedicated statistics test.
This commit is contained in:
Dark-Alex-17 committed 2026-09-17 15:19:16 -06:00
1 parent a68de41025
commit 289abbd8eb
11 files changed
+18 -12

No files matched your search

@@ -31,8 +31,8 @@ use strum::EnumIter;
use {
super::modals::EditionDetailsModal,
crate::models::readarr_models::{
AuthorStatus, BookFile, DownloadStatus, Edition, MediaInfo, MonitorType, NewItemMonitorType,
Ratings, ReadarrHistoryEventType, ReadarrTaskName,
AuthorStatus, BookFile, BookStatistics, DownloadStatus, Edition, MediaInfo, MonitorType,
NewItemMonitorType, Ratings, ReadarrHistoryEventType, ReadarrTaskName,
},
crate::models::servarr_models::{IndexerField, Quality, QualityWrapper},
crate::models::stateful_table::SortOption,
@@ -292,6 +292,12 @@ impl ReadarrData<'_> {
any_edition_ok: true,
page_count: Some(288),
release_date: Some(date),
statistics: Some(BookStatistics {
book_file_count: 3,
total_book_count: 7,
size_on_disk: 2469606195,
percent_of_books: 42.86,
}),
..Book::default()
};
let readarr_history_item = ReadarrHistoryItem {
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Files Release Date Size ││
││=> 🏷 Test Book N/A 2023-05-20 N/A ││
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
││ ││
││ ││
││ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
││ Monitored Title │ │Date Size ││
││=> 🏷 Test Book │ │20 N/A ││
││=> 🏷 Test Book │ │20 2.30 GB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Files Release Date Size ││
││=> 🏷 Test Book N/A 2023-05-20 N/A ││
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
││ ││
││ ││
││ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Files Release Date Size ││
││=> 🏷 Test Book N/A 2023-05-20 N/A ││
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
││ ││
││ ││
││ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
││ Monitored Title │ │Date Size ││
││=> 🏷 Test Book │ │20 N/A ││
││=> 🏷 Test Book │ │20 2.30 GB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search │Do you want to trigger an automatic search of your indexers│ ││
││─────────────────────────────────────────│ for all monitored book(s) for the author: Test Author? │───────────────────────────────────────────││
││ Monitored Title │ │Date Size ││
││=> 🏷 Test Book │ │20 N/A ││
││=> 🏷 Test Book │ │20 2.30 GB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search │ Do you really want to delete the book: │ ││
││─────────────────────────────────────────│ Test Book? │───────────────────────────────────────────││
││ Monitored Title │ │Date Size ││
││=> 🏷 Test Book │ │20 N/A ││
││=> 🏷 Test Book │ │20 2.30 GB ││
││ │ ╭───╮ │ ││
││ │ Delete Book Files: │ ✔ │ │ ││
││ │ ╰───╯ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search │ Do you want to trigger an update and disk scan for the │ ││
││─────────────────────────────────────────│ author: Test Author? │───────────────────────────────────────────││
││ Monitored Title │ │Date Size ││
││=> 🏷 Test Book │ │20 N/A ││
││=> 🏷 Test Book │ │20 2.30 GB ││
││ │ │ ││
││ │ │ ││
││ │ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History ││ ╰───╯ │ ││
││──────────────────│ ╭─────────────────────────────────────────────────╮ │────────────────────││
││ Monitored │ Monitor New Books: │All Books ▼ │ │ ││
││=> 🏷 │ ╰─────────────────────────────────────────────────╯ │ ││
││=> 🏷 │ ╰─────────────────────────────────────────────────╯ │B ││
││ │ ╭─────────────────────────────────────────────────╮ │ ││
││ │ Quality Profile: │eBook ▼ │ │ ││
││ │ ╰─────────────────────────────────────────────────╯ │ ││
@@ -22,7 +22,7 @@ expression: output
││ Books │ History │ Author Search ││
││─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────││
││ Monitored Title Files Release Date Size ││
││=> 🏷 Test Book N/A 2023-05-20 N/A ││
││=> 🏷 Test Book 3/7 2023-05-20 2.30 GB ││
││ ││
││ ││
││ ││