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