v0.79.2: the version button shows a button face on hover once an update is ready; both cancel ✕s are always buttons

This commit is contained in:
2026-10-25 14:30:30 -07:00
parent e4ad527493
commit 1dbb4b81eb
6 changed files with 58 additions and 14 deletions
+26
View File
@@ -83,3 +83,29 @@ def test_window_wires_it_to_go_to_current_song(qapp, tmp_path, monkeypatch):
assert panel._clickable
finally:
window.close()
def test_version_button_shows_a_face_on_hover_only_once_an_update_is_ready(qapp):
from PyQt6.QtCore import QObject, pyqtSignal
from lintunes.gui.version_button import VersionButton
class Updater(QObject):
update_available = pyqtSignal(int)
update_failed = pyqtSignal(str)
def short_hash(self):
return ""
button = VersionButton(Updater())
assert ":hover" not in button.styleSheet() # an inert readout
button._on_update_available(3)
assert ":hover" in button.styleSheet() and ":pressed" in button.styleSheet()
button.refresh_theme() # a theme switch keeps it
assert ":hover" in button.styleSheet()
def test_cancel_transfer_is_always_a_button(qapp):
from lintunes.gui.main_window import _CancelSyncButton
button = _CancelSyncButton()
assert not button.isFlat()
assert "border: none" not in button.styleSheet()