summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_spa_ordering.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_spa_ordering.py')
-rw-r--r--packages/meshbay-hub/tests/test_spa_ordering.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/test_spa_ordering.py b/packages/meshbay-hub/tests/test_spa_ordering.py
index 1329b74..04c5159 100644
--- a/packages/meshbay-hub/tests/test_spa_ordering.py
+++ b/packages/meshbay-hub/tests/test_spa_ordering.py
@@ -167,3 +167,35 @@ def test_no_caller_waits_for_one_chunk_at_a_time():
app = APP.read_text()
assert "uploadChunk(" not in app, (
"a per-chunk await is back in the SPA; use transport.uploadFile()")
+
+
+# ── Transfers outlive the page ──────────────────────────────────────────────
+#
+# Downloads and uploads used to be state inside GroupPage, so leaving a group
+# unmounted the component, its cleanup closed the DataChannel, and a half-written
+# file was all you had. The store in transfers.js owns them now; these check the
+# two ends of that, since neither shows up in any Python test.
+
+def test_leaving_a_group_hands_the_transport_over_rather_than_closing_it():
+ app = APP.read_text()
+ cleanup = app[app.index(" return () => {\n cancelled = true;"):]
+ cleanup = cleanup[:cleanup.index("\n }, [groupId")]
+ assert "releaseWhenIdle" in cleanup, (
+ "the group page closes its transport directly again — a running "
+ "download would die with the page")
+ assert ".close()" not in cleanup
+
+
+def test_signing_out_stops_them():
+ app = APP.read_text()
+ logout = app[app.index(" logout: () => {"):]
+ logout = logout[:logout.index("navigate('/login')")]
+ assert "transfers.reset()" in logout, (
+ "logout must cancel transfers: they run on tokens that stop being ours")
+
+
+def test_the_files_panel_no_longer_carries_its_own_progress_bars():
+ """They moved next to the bell, where they stay visible across the app."""
+ app = APP.read_text()
+ for gone in ("setUlState", "setDlState", "dl-bar"):
+ assert gone not in app, f"{gone} survived the move to the transfer widget"