From ef74cde3d8ec38f6bd0e75ff8717e2aa09459f56 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Thu, 10 Sep 2026 23:20:38 -0600 Subject: [PATCH] test(myqbz): align tracks_text test with the #766 empty-column contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- crates/qbz-qt/src/myqbz_detail_qt.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/crates/qbz-qt/src/myqbz_detail_qt.rs b/crates/qbz-qt/src/myqbz_detail_qt.rs index 805347efb..2cc7ff804 100644 --- a/crates/qbz-qt/src/myqbz_detail_qt.rs +++ b/crates/qbz-qt/src/myqbz_detail_qt.rs @@ -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]