test(myqbz): align tracks_text test with the #766 empty-column contract
The stale test still asserted the pre-#766 behavior (em-dash for an unknown album count, "1" for a track). #766 made the tracks column empty for a track and empty for an unknown album count (filled only once resolve_items backfills) — the shipped, smoke-validated behavior. Update the test to match; the CI qt gate was red on this alone. cc
This commit is contained in:
1 file changed
+11
-5
@@ -2517,12 +2517,18 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tracks_text_uses_em_dash_for_unknown_counts() {
|
||||
let mut it = item(0, "A", ItemType::Album, AlbumSource::Qobuz);
|
||||
it.track_count = None;
|
||||
assert_eq!(tracks_text(&it), "\u{2014}");
|
||||
fn tracks_text_is_empty_for_track_and_unknown_album_count() {
|
||||
// #766: a single track has no track count — the column stays empty.
|
||||
let track = item(1, "B", ItemType::Track, AlbumSource::Qobuz);
|
||||
assert_eq!(tracks_text(&track), "1");
|
||||
assert_eq!(tracks_text(&track), "");
|
||||
// An album shows its stored count (item() seeds position + 1 = 1).
|
||||
let album = item(0, "A", ItemType::Album, AlbumSource::Qobuz);
|
||||
assert_eq!(tracks_text(&album), "1");
|
||||
// An album with an unknown count stays empty until `resolve_items`
|
||||
// backfills the resolved count — no em-dash placeholder.
|
||||
let mut unknown = item(2, "C", ItemType::Album, AlbumSource::Qobuz);
|
||||
unknown.track_count = None;
|
||||
assert_eq!(tracks_text(&unknown), "");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user