Hopefully checkboxes will report there state now.
This commit is contained in:
1 parent
059e4e124b
commit
f39ec4d51a
5 files changed
+81
-15
No files matched your search
@@ -80,7 +80,7 @@ def test_browse_and_back_replace_rows_without_hidden_descendants(window):
|
||||
QTest.keyClick(page.table, Qt.Key_Backspace)
|
||||
assert page.selectedData()['type'] == 'artist'
|
||||
assert page.model.rowCount() == 1
|
||||
assert page.model.columnCount() == 2
|
||||
assert page.model.columnCount() == 3
|
||||
assert not page.backButton.isEnabled()
|
||||
assert not pending
|
||||
assert page.table.hasFocus()
|
||||
@@ -213,8 +213,38 @@ def test_native_accessibility_reports_table_headers_and_current_cells(window):
|
||||
interface = QAccessible.queryAccessibleInterface(page.table)
|
||||
assert interface.role() == QAccessible.Table
|
||||
names = [interface.child(i).text(QAccessible.Name) for i in range(interface.childCount())]
|
||||
assert 'Artist' in names and 'Albums' in names
|
||||
assert 'Selected' in names and 'Artist' in names and 'Albums' in names
|
||||
assert 'Song' not in names and 'Album' not in names
|
||||
assert page.table.currentIndex().column() == 1
|
||||
|
||||
|
||||
def test_checkbox_cell_exposes_checked_state_and_accessible_text(window):
|
||||
w, _ = window
|
||||
page = w.libraryBrowser.currentWidget()
|
||||
checkboxIndex = page.model.index(0, 0)
|
||||
announcements = []
|
||||
w.libraryBrowser.checkedStateAnnouncement.connect(announcements.append)
|
||||
|
||||
assert page.model.headerData(0, Qt.Horizontal) == 'Selected'
|
||||
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Select Artist, unchecked'
|
||||
assert page.model.flags(checkboxIndex) & Qt.ItemIsUserCheckable
|
||||
interface = QAccessible.queryAccessibleInterface(page.table)
|
||||
checkbox = next(interface.child(i) for i in range(interface.childCount())
|
||||
if interface.child(i).text(QAccessible.Name) == 'Select Artist, unchecked')
|
||||
assert checkbox.state().checkable
|
||||
assert not checkbox.state().checked
|
||||
|
||||
QTest.keyClick(page.table, Qt.Key_Space)
|
||||
QApplication.processEvents()
|
||||
|
||||
assert page.model.data(checkboxIndex, Qt.CheckStateRole) == Qt.Checked
|
||||
assert page.model.data(checkboxIndex, Qt.AccessibleTextRole) == 'Select Artist, checked'
|
||||
assert announcements == ['Artist checked; 1 item checked.']
|
||||
interface = QAccessible.queryAccessibleInterface(page.table)
|
||||
checkbox = next(interface.child(i) for i in range(interface.childCount())
|
||||
if interface.child(i).text(QAccessible.Name) == 'Select Artist, checked')
|
||||
assert checkbox.state().checkable
|
||||
assert checkbox.state().checked
|
||||
|
||||
|
||||
def test_collection_actions_and_queue_use_current_payload(window, monkeypatch):
|
||||
|
||||
Reference in new issue
Block a user