summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_app_settings_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_app_settings_plugin.py')
-rw-r--r--packages/meshbay-hub/tests/test_app_settings_plugin.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_app_settings_plugin.py b/packages/meshbay-hub/tests/test_app_settings_plugin.py
index d469d8a4..3d11c9ef 100644
--- a/packages/meshbay-hub/tests/test_app_settings_plugin.py
+++ b/packages/meshbay-hub/tests/test_app_settings_plugin.py
@@ -174,6 +174,18 @@ def test_a_read_only_root_cannot_be_chosen_as_a_destination():
"Chat's directory picker does not require a writable root")
+def test_purging_the_chat_asks_first():
+ """
+ A purge deletes every message for every member and cannot be undone: the
+ button asks before sending the operation, never after.
+ """
+ chat = (STATIC / "chat-app-settings.js").read_text(encoding="utf-8")
+ asked = chat.index("ask(t('settings_app.chat_purge_confirm'))")
+ sent = chat.index("transport.purgeChat(signFn)")
+ assert asked < sent, "the purge is sent before the confirmation"
+ assert "if (!(await ask(t('settings_app.chat_purge_confirm')))) return;" in chat
+
+
def test_the_picker_can_clear_a_selection():
"""
Confirming with nothing chosen is how an app's directories are unset, and