aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_gui.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_gui.py')
-rw-r--r--tests/test_gui.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index bd08e7f..ca51c3c 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -651,6 +651,28 @@ class SmokeTest(unittest.TestCase):
w.hint_dialogs[0].build()
self.assertIn(("job-start", "slackrepo", "update", "--preview", "nuclei"), remote.calls)
+ def test_clear_with_filter_and_current_row(self):
+ # regression: Clear emitted layoutChanged with no layoutAboutToBeChanged;
+ # behind a filter, with a current row, the proxy's stale indexes segfaulted Qt
+ rows = [inv_row(f"games/g{i}", maintainer="orphaned - no maintainer" if i % 2 else "A")
+ for i in range(40)] + [inv_row(f"misc/m{i}") for i in range(40)]
+ w, _ = self.window(inventory=({"columns": COLS, "rows": rows}, None))
+ w.show()
+ tab = w.open_packages()
+ tab.chips["orphaned"].setChecked(True)
+ tab.query.setText("cat:games")
+ for i in range(3):
+ tab.table.clicked.emit(tab.proxy.index(i, 1))
+ tab.table.setCurrentIndex(tab.proxy.index(2, 1))
+ app.processEvents()
+ select, clear = tab.keys
+ clear.activated.emit()
+ app.processEvents()
+ self.assertEqual(tab.count.text(), "20 shown · 0 selected")
+ select.activated.emit()
+ app.processEvents()
+ self.assertEqual(tab.count.text(), "20 shown · 20 selected")
+
def test_packages_new_hint(self):
w, remote = self.window(**{"job-start": ({"id": "20260101-000001-hint-new"}, None)})
w.poll_jobs()