Skip to content

Commit

Permalink
test(test_delete_sources): parameterized functional test for deletion…
Browse files Browse the repository at this point in the history
… of one or more sources

This is a complete rewrite of this test, which now (a) distinguishes
between single- and multi-select behavior and (b) checks that the
individual sources selected for deletion are confirmed and deleted, not
only the *number* of sources selected.

This includes a workaround for #2273.  Here we also change
securedrop_client.gui.widgets.BatchActionToolbar.on_action_triggered()
to call QDialog.open(), which is modal with QDialog.setModal(), rather
than QDialog.exec(), which is modal *and* blocking, which blocks pytest
timers as well as the main event loop.
  • Loading branch information
cfm committed Oct 29, 2024
1 parent c267ce7 commit f6bd2c9
Show file tree
Hide file tree
Showing 5 changed files with 2,361 additions and 1,246 deletions.
3 changes: 2 additions & 1 deletion client/securedrop_client/gui/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,9 @@ def on_action_triggered(self) -> None:
targets = self.controller.get_selected_sources()
if targets is not None:
dialog = DeleteSourceDialog(targets)
self._last_dialog = dialog # FIXME: workaround for #2273
dialog.accepted.connect(lambda: self.controller.delete_sources(targets))
dialog.exec()
dialog.open()
else:
# No selected sources should return an empty set, not None
logger.error("Toolbar action triggered without valid data from controller.")
Expand Down
Loading

0 comments on commit f6bd2c9

Please sign in to comment.