From 5e2670f59fab01b63fe9fd51900aa7c211f4b5d2 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 8 May 2026 16:37:08 -0600 Subject: [PATCH] test(qbz-library): empty-folder case for list_folder_tracks_recursive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify the recursive listing returns an empty Vec (not an error) when the requested folder path has no descendants — frontend treats empty as "nothing to play/queue" and skips the toast. cc --- crates/qbz-library/src/database.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/qbz-library/src/database.rs b/crates/qbz-library/src/database.rs index 0b8138fc0..5dcc0395b 100644 --- a/crates/qbz-library/src/database.rs +++ b/crates/qbz-library/src/database.rs @@ -5139,4 +5139,14 @@ mod folder_tree_tests { assert!(titles.contains(&"TwoHundred".to_string())); assert!(!titles.contains(&"Decoy".to_string())); } + + #[test] + fn list_folder_tracks_recursive_returns_empty_for_unknown_path() { + // A folder path with no matching descendants must yield an empty + // Vec rather than an error — frontend treats empty as "nothing + // to play/queue" and skips the toast. + let (_tmp, db) = fresh_db(); + let tracks = db.list_folder_tracks_recursive("/m/does/not/exist").unwrap(); + assert!(tracks.is_empty()); + } }