diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_hub_api.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_hub_api.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/packages/meshbay-hub/tests/test_hub_api.py b/packages/meshbay-hub/tests/test_hub_api.py index 5314b93..724c8ec 100644 --- a/packages/meshbay-hub/tests/test_hub_api.py +++ b/packages/meshbay-hub/tests/test_hub_api.py @@ -722,19 +722,26 @@ async def test_ip_log_cleanup(app): @pytest.mark.asyncio async def test_webapp_html_includes_scripts(client): - """SPA HTML shell includes all required script tags.""" + """SPA HTML shell includes all required script tags. + + The paths carry a build fingerprint (`/a/<hash>/app.js`) so that a browser + cannot serve an older build out of its own cache — see + test_asset_versioning.py. What this test still owns is that every piece is + referenced at all, and in an order where each one's dependencies are + already loaded. + """ + from meshbay_hub.api.webapp import ASSET_V + r = await client.get("/") assert r.status_code == 200 html = r.text assert "<!DOCTYPE html>" in html assert '<div id="app">' in html - assert 'src="/keyderive.js"' in html - assert 'src="/crypto.js"' in html - assert 'src="/transport.js"' in html - assert 'src="/app.js"' in html + for asset in ("keyderive.js", "crypto.js", "transport.js", "app.js"): + assert f'src="/a/{ASSET_V}/{asset}"' in html, f"{asset} is not loaded" assert 'type="module"' in html assert 'rel="stylesheet"' in html - assert 'href="/style.css"' in html + assert f'href="/a/{ASSET_V}/style.css"' in html # ── Password split (T1 fix) ───────────────────────────────────────────────── |