diff options
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)] |