aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_transport_contracts.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_transport_contracts.py')
-rw-r--r--packages/meshbay-hub/tests/test_transport_contracts.py18
1 files changed, 13 insertions, 5 deletions
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")]