summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/harness/chat_send_probe.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-09-25 11:09:12 +0200
committerChristophe Besson <cbesson@gmail.com>2026-09-25 12:07:49 +0200
commit6348698322e5bfcb80d0ef0dcd833ba4e6179640 (patch)
tree6d4f47a0a1745ef5ae912368d078cf681b9fcd19 /packages/meshbay-hub/tests/harness/chat_send_probe.py
parent71ea15a926d02437a65b8d788834c46f4e6df9a3 (diff)
downloadmeshbay-6348698322e5bfcb80d0ef0dcd833ba4e6179640.tar.gz
test(hub): read the transport wherever it is split
spa_source.transport_files() takes the classic transport*.js scripts from the hub's shell, in load order. Every test that read transport.js reads them all, the Node harnesses run them joined as one scope, the chat probe loads each, and the desktop shell must load them in order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/harness/chat_send_probe.py')
-rw-r--r--packages/meshbay-hub/tests/harness/chat_send_probe.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/packages/meshbay-hub/tests/harness/chat_send_probe.py b/packages/meshbay-hub/tests/harness/chat_send_probe.py
index d343c50..7569628 100644
--- a/packages/meshbay-hub/tests/harness/chat_send_probe.py
+++ b/packages/meshbay-hub/tests/harness/chat_send_probe.py
@@ -77,6 +77,9 @@ import threading
import time
from pathlib import Path
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from spa_source import transport_files # noqa: E402
+
STATIC = Path(__file__).resolve().parents[2] / "src" / "meshbay_hub" / "static"
PORT = 8755
RECORDS = []
@@ -104,7 +107,10 @@ def _page() -> str:
.replace("__GROUP_ID__", GROUP_ID)
.replace("__GEK_HEX__", GEK.hex())
.replace("__KEYS_NONCE_HEX__", sealed["nonce"].hex())
- .replace("__KEYS_CT_HEX__", sealed["ct"].hex()))
+ .replace("__KEYS_CT_HEX__", sealed["ct"].hex())
+ # transport.js and the parts split out of it, in the shell's order.
+ .replace("__TRANSPORT_SCRIPTS__", "\n".join(
+ f'<script src="/{p.name}"></script>' for p in transport_files())))
PAGE_TEMPLATE = r"""<!doctype html><html><head><meta charset=utf-8>
<link rel="stylesheet" href="/style.css"></head>
@@ -119,7 +125,7 @@ PAGE_TEMPLATE = r"""<!doctype html><html><head><meta charset=utf-8>
Without them a send fails with "cannot read properties of undefined". -->
<script src="/crypto.js"></script>
<script src="/keyderive.js"></script>
-<script src="/transport.js"></script>
+__TRANSPORT_SCRIPTS__
<script type="module">
import { html, render, useRef, useState, useEffect } from '/vendor/htm-preact.js';
import { ChatPanel } from '/chat-app.js';