test(lidarr): give the track and history fixtures distinct ids

The shared track held id, artist id, track file id, and album id all
equal to 1, and the shared history item held id, album id, artist id,
and track id all equal to 1, so reading the wrong one of those fields
could not fail any test that uses them. Move the track to id 5, artist
id 3, and track file id 7 (with the shared track file moved to id 7 so
the album view still finds its quality and audio info), and move the
history item to id 13, artist id 3, and track id 5. Both album ids stay
at 1 so the fully populated album view still shows its track as
downloading. Update the seven assertions that named the old ids.
This commit is contained in:
Dark-Alex-17 committed 2026-09-17 18:16:17 -06:00
1 parent 9822597b56
commit 4f78a5940f
4 files changed
+14 -14

No files matched your search

+3 -3
View File
@@ -498,7 +498,7 @@ mod tests {
assert!(app.is_loading);
assert_eq!(
rx.recv().await.unwrap(),
LidarrEvent::GetTrackDetails(1).into()
LidarrEvent::GetTrackDetails(5).into()
);
assert!(!app.data.lidarr_data.prompt_confirm);
assert_eq!(app.tick_count, 0);
@@ -518,7 +518,7 @@ mod tests {
assert!(app.is_loading);
assert_eq!(
rx.recv().await.unwrap(),
LidarrEvent::GetTrackHistory(1, 1, 1).into()
LidarrEvent::GetTrackHistory(1, 1, 5).into()
);
assert!(!app.data.lidarr_data.prompt_confirm);
assert_eq!(app.tick_count, 0);
@@ -759,7 +759,7 @@ mod tests {
album_details_modal.tracks.set_items(vec![track()]);
app.data.lidarr_data.album_details_modal = Some(album_details_modal);
assert_eq!(app.extract_track_id().await, 1);
assert_eq!(app.extract_track_id().await, 5);
}
#[tokio::test]
+1 -1
View File
@@ -631,7 +631,7 @@ mod tests {
async fn test_handle_list_track_history_command() {
let expected_artist_id = 1;
let expected_album_id = 1;
let expected_track_id = 1;
let expected_track_id = 5;
let mut mock_network = MockNetworkTrait::new();
mock_network
.expect_handle_network_event()
@@ -255,7 +255,7 @@ mod tests {
)]
#[case(
ActiveLidarrBlock::DeleteTrackFilePrompt,
LidarrEvent::DeleteTrackFile(1)
LidarrEvent::DeleteTrackFile(7)
)]
fn test_album_details_prompt_confirm_submit(
#[case] prompt_block: ActiveLidarrBlock,
@@ -606,7 +606,7 @@ mod tests {
)]
#[case(
ActiveLidarrBlock::DeleteTrackFilePrompt,
LidarrEvent::DeleteTrackFile(1)
LidarrEvent::DeleteTrackFile(7)
)]
fn test_album_details_prompt_confirm_confirm_key(
#[case] prompt_block: ActiveLidarrBlock,
@@ -752,7 +752,7 @@ mod tests {
)
.extract_track_file_id();
assert_eq!(track_file_id, 1);
assert_eq!(track_file_id, 7);
}
#[test]
@@ -282,11 +282,11 @@ pub mod test_utils {
pub fn lidarr_history_item() -> LidarrHistoryItem {
LidarrHistoryItem {
id: 1,
id: 13,
source_title: "Test source title".into(),
album_id: 1,
artist_id: 1,
track_id: 1,
artist_id: 3,
track_id: 5,
quality: quality_wrapper(),
date: DateTime::from(DateTime::parse_from_rfc3339("2023-01-01T00:00:00Z").unwrap()),
event_type: LidarrHistoryEventType::Grabbed,
@@ -459,7 +459,7 @@ pub mod test_utils {
pub fn track_file() -> TrackFile {
TrackFile {
id: 1,
id: 7,
path: "/music/P!nk/TRUSTFALL/01 - When I Get There.flac".to_string(),
size: 39216378,
quality: quality_wrapper(),
@@ -471,10 +471,10 @@ pub mod test_utils {
pub fn track() -> Track {
Track {
id: 1,
artist_id: 1,
id: 5,
artist_id: 3,
foreign_track_id: "test-foreign-track-id".to_string(),
track_file_id: 1,
track_file_id: 7,
album_id: 1,
explicit: false,
track_number: "1".to_string(),