summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/harness/chat_send_probe.py
diff options
context:
space:
mode:
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';