diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-30 23:57:57 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-30 23:57:57 +0200 |
| commit | f6e80064ff8c4869a6ba2cef908cc54326948463 (patch) | |
| tree | 1a04c004ed8006ec8c486a5c8a4d632ee257d395 /packages/meshbay-hub/tests | |
| parent | 3706dc15ff3be7acf2ade77977a9fca7a8b4efc5 (diff) | |
| download | meshbay-f6e80064ff8c4869a6ba2cef908cc54326948463.tar.gz | |
refactor(ui): extract Settings, Profile and Admin pages from app.js
Admin page is lazy-loaded so non-admin users never fetch it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests')
| -rw-r--r-- | packages/meshbay-hub/tests/test_spa_ordering.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/meshbay-hub/tests/test_spa_ordering.py b/packages/meshbay-hub/tests/test_spa_ordering.py index d00b9a0..ba042d1 100644 --- a/packages/meshbay-hub/tests/test_spa_ordering.py +++ b/packages/meshbay-hub/tests/test_spa_ordering.py @@ -115,9 +115,9 @@ def test_the_ack_still_verifies_the_announced_node_key(): # The group-page refactor split what used to be one app.js into one file per # "application" (chat-app.js, files-app.js, video-player.js) plus -# group-settings.js and the group shell itself, group-page.js. AdminPage and -# App() stayed in app.js. `_component` below is told which file to read a -# given top-level component from. +# group-settings.js and the group shell itself, group-page.js. +# `_component` below is told which file to read a given top-level +# component from. APP = STATIC / "app.js" COMPONENT_FILES = { "GroupSettingsPanel": STATIC / "group-settings.js", @@ -125,6 +125,7 @@ COMPONENT_FILES = { "ChatPanel": STATIC / "chat-app.js", "FilesPanel": STATIC / "files-app.js", "VideoPlayer": STATIC / "video-player.js", + "AdminPage": STATIC / "admin-page.js", } @@ -132,8 +133,12 @@ def _component(name: str) -> str: """The source of one top-level `function Name(...)`, up to the next one.""" source = COMPONENT_FILES.get(name, APP).read_text() start = source.find(f"\nfunction {name}(") + if start == -1: + start = source.find(f"\nexport function {name}(") assert start != -1, f"{name} is gone — update this test" end = source.find("\nfunction ", start + 1) + if end == -1: + end = source.find("\nexport function ", start + 1) return source[start:end if end != -1 else len(source)] |