summaryrefslogtreecommitdiff
path: root/tests/test_info_tab_extensions.py
diff options
context:
space:
mode:
authorWarry <FunWarry@users.noreply.github.com>2025-12-03 09:40:49 +0100
committerWarry <FunWarry@users.noreply.github.com>2025-12-03 09:40:49 +0100
commit85f7e33b28985afd62a99d64b3e7a6883d62b072 (patch)
tree07d59dae4ed8be7b03cc2058eefdcf73d69596f6 /tests/test_info_tab_extensions.py
parent0facd232dc089b164acd7255983f8f078aaaa462 (diff)
parentc077e2b4977ea3219bce9a0f7c4518e0838baf87 (diff)
downloadtidal-dl-ng-85f7e33b28985afd62a99d64b3e7a6883d62b072.tar.gz
Merge branch 'feature/informations-window' into fusion-refafac-setings
# Conflicts: # .gitignore
Diffstat (limited to 'tests/test_info_tab_extensions.py')
-rw-r--r--tests/test_info_tab_extensions.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/test_info_tab_extensions.py b/tests/test_info_tab_extensions.py
new file mode 100644
index 0000000..4288cc8
--- /dev/null
+++ b/tests/test_info_tab_extensions.py
@@ -0,0 +1,28 @@
+from unittest.mock import patch
+
+
+def test_new_fields_initial_state(info_tab_widget, qt_app):
+ """New fields must exist and default to '—'."""
+ assert hasattr(info_tab_widget, "lbl_track_number")
+ assert info_tab_widget.lbl_track_number.text() == "—"
+ assert hasattr(info_tab_widget, "lbl_bpm")
+ assert info_tab_widget.lbl_bpm.text() == "—"
+ # Note: lbl_label, lbl_genres, lbl_producers and lbl_composers are not available
+ # as these fields cannot be retrieved from TIDAL API
+
+
+def test_bpm_population(info_tab_widget, mock_track, qt_app):
+ """Ensure BPM field is populated when present."""
+ # Add BPM attribute to mock_track
+ mock_track.bpm = 120
+
+ with patch("tidal_dl_ng.ui.info_tab_widget.name_builder_title", return_value="Test Track"):
+ info_tab_widget._populate_track_details(mock_track)
+ qt_app.processEvents()
+
+ # Expect loading indicator first due to async extras
+ assert info_tab_widget.lbl_bpm.text() == "⏳ Loading..."
+ # Simulate async arrival of extras
+ info_tab_widget._update_extras_ui({"bpm": 120})
+ qt_app.processEvents()
+ assert info_tab_widget.lbl_bpm.text() == "120"