diff options
Diffstat (limited to 'packages/meshbay-hub/tests')
| -rw-r--r-- | packages/meshbay-hub/tests/test_hook_ordering.py | 1 | ||||
| -rw-r--r-- | packages/meshbay-hub/tests/test_hub_address_seam.py | 3 | ||||
| -rw-r--r-- | packages/meshbay-hub/tests/test_transport_contracts.py | 18 |
3 files changed, 16 insertions, 6 deletions
diff --git a/packages/meshbay-hub/tests/test_hook_ordering.py b/packages/meshbay-hub/tests/test_hook_ordering.py index 2114b45..f292b3e 100644 --- a/packages/meshbay-hub/tests/test_hook_ordering.py +++ b/packages/meshbay-hub/tests/test_hook_ordering.py @@ -37,6 +37,7 @@ STATIC_FILES = [ "video-player.js", "video-app.js", "music-app.js", "music-player.js", "photos-app.js", "group-settings.js", + "auth-page.js", "explore-page.js", "create-group-page.js", ] pytestmark = pytest.mark.skipif(not APP.exists(), reason="SPA sources unavailable") diff --git a/packages/meshbay-hub/tests/test_hub_address_seam.py b/packages/meshbay-hub/tests/test_hub_address_seam.py index 392a21c..ccdac7d 100644 --- a/packages/meshbay-hub/tests/test_hub_address_seam.py +++ b/packages/meshbay-hub/tests/test_hub_address_seam.py @@ -23,7 +23,8 @@ STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static" # Files that issue hub requests. `app.js` gets its base from `platform.hubBase()` # and the rest reach the adapter through the global it publishes. -CALLERS = ["app.js", "keyderive.js", "transport.js", "crypto.js"] +CALLERS = ["app.js", "keyderive.js", "transport.js", "crypto.js", + "auth-page.js", "explore-page.js", "create-group-page.js"] def _source(name: str) -> str: diff --git a/packages/meshbay-hub/tests/test_transport_contracts.py b/packages/meshbay-hub/tests/test_transport_contracts.py index 6c178a6..6011ddb 100644 --- a/packages/meshbay-hub/tests/test_transport_contracts.py +++ b/packages/meshbay-hub/tests/test_transport_contracts.py @@ -27,11 +27,14 @@ APP = STATIC / "app.js" # effect moved out of app.js in the group-page refactor. CHAT_APP = STATIC / "chat-app.js" GROUP_PAGE = STATIC / "group-page.js" +CREATE_GROUP = STATIC / "create-group-page.js" SPLIT_FILES = [APP, GROUP_PAGE, CHAT_APP, STATIC / "files-app.js", STATIC / "video-player.js", STATIC / "video-app.js", STATIC / "music-app.js", STATIC / "music-player.js", STATIC / "photos-app.js", - STATIC / "group-settings.js"] + STATIC / "group-settings.js", + STATIC / "auth-page.js", STATIC / "explore-page.js", + CREATE_GROUP] pytestmark = pytest.mark.skipif( not TRANSPORT.exists(), reason="the SPA sources are not available") @@ -57,6 +60,11 @@ def group_page(): return GROUP_PAGE.read_text() +@pytest.fixture(scope="module") +def create_group(): + return CREATE_GROUP.read_text() + + def test_chat_history_pages_backwards(transport): body = transport[transport.index("async fetchChatHistory"):] body = body[:body.index("\n }")] @@ -188,7 +196,7 @@ def test_a_refusal_from_the_node_counts_as_present(group_page): # ── The create-group form ───────────────────────────────────────────────────── -def test_the_form_asks_one_question_not_two(app): +def test_the_form_asks_one_question_not_two(create_group): """ Visibility and admission were separate selectors that could only ever be set together, and the form knew it — picking Public reached over and set the @@ -199,7 +207,7 @@ def test_the_form_asks_one_question_not_two(app): So there is one selector. "Open" is what makes a group listed, and the request derives the rest. """ - form = app[app.index("function CreateGroupFormSimple"):] + form = create_group[create_group.index("function CreateGroupFormSimple"):] form = form[:form.index("\n}\n")] assert "setVisibility(" not in form, "the visibility selector is back" @@ -228,8 +236,8 @@ def test_the_strings_the_visibility_box_used_are_gone(app): assert f"'{key}'" not in text, f"{locale.name} still carries {key}" -def test_the_form_starts_on_a_combination_the_api_accepts(app): - form = app[app.index("function CreateGroupFormSimple"):] +def test_the_form_starts_on_a_combination_the_api_accepts(create_group): + form = create_group[create_group.index("function CreateGroupFormSimple"):] assert "useState('invite')" in form[:form.index("return html")] |