Added keyboard shortcut help.
This commit is contained in:
1 parent
33bba7282e
commit
bd6cfb83eb
3 files changed
+87
-2
No files matched your search
@@ -9,7 +9,7 @@ from unittest.mock import Mock
|
||||
import pytest
|
||||
from PySide6.QtCore import Qt
|
||||
from PySide6.QtMultimedia import QMediaPlayer
|
||||
from PySide6.QtWidgets import QApplication, QWidget, QTreeWidgetItem
|
||||
from PySide6.QtWidgets import QApplication, QDialog, QTableWidget, QTreeWidgetItem, QWidget
|
||||
|
||||
from src.api.client import SubsonicClient
|
||||
from src.api.models import Song, Playlist
|
||||
@@ -49,6 +49,24 @@ def test_background_error_survives_until_ui_delivery(app):
|
||||
assert str(errors[0]) == "synthetic failure"
|
||||
|
||||
|
||||
def test_keyboard_shortcuts_dialog_has_accessible_shortcut_table(app, monkeypatch):
|
||||
parent = QWidget()
|
||||
|
||||
def inspect_dialog(dialog):
|
||||
table = dialog.findChild(QTableWidget)
|
||||
assert dialog.windowTitle() == "Keyboard Shortcuts"
|
||||
assert table.accessibleName() == "Keyboard shortcuts"
|
||||
assert table.horizontalHeaderItem(0).text() == "Shortcut"
|
||||
assert table.horizontalHeaderItem(1).text() == "Action"
|
||||
assert table.rowCount() >= 20
|
||||
assert table.item(15, 0).text() == "Ctrl+Down or 9"
|
||||
assert table.item(15, 1).text() == "Decrease volume"
|
||||
return QDialog.Accepted
|
||||
|
||||
monkeypatch.setattr(QDialog, "exec", inspect_dialog)
|
||||
MainWindow.showKeyboardShortcuts(parent)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("refresh", ["forced", "full", "incremental"])
|
||||
def test_refresh_bypasses_api_memory_cache(tmp_path, refresh):
|
||||
raw = SubsonicClient("https://fake.example", "user", "fake")
|
||||
|
||||
Reference in new issue
Block a user