aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_search_fanout.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/test_search_fanout.py')
-rw-r--r--packages/meshbay-hub/tests/test_search_fanout.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_search_fanout.py b/packages/meshbay-hub/tests/test_search_fanout.py
index 23a8b67d..73ba4ac0 100644
--- a/packages/meshbay-hub/tests/test_search_fanout.py
+++ b/packages/meshbay-hub/tests/test_search_fanout.py
@@ -50,7 +50,7 @@ import subprocess
from pathlib import Path
import pytest
-from spa_source import search_argv
+from spa_source import search_argv, search_source
STATIC = Path(__file__).resolve().parents[1] / "src" / "meshbay_hub" / "static"
SEARCH_PAGE = STATIC / "search-page.js"
@@ -174,3 +174,18 @@ def test_no_more_groups_are_dialled_at_once_than_the_ceiling():
out = _sweep(groups=12, dead=list(range(12)))
assert out["inFlight"] == 6
assert out["finishedAt"] == 2 * DEAD_MS
+
+
+def test_a_group_refused_the_local_network_is_named_apart():
+ """Not "unreachable": the page names these groups and says what to change,
+ and they are dialled last next time like any group that did not answer."""
+ out = _sweep(groups=4, dead=[1, 2], lanRefused=[2])
+ assert out["outcome"] == {"unreachable": ["G1"], "lanBlocked": ["G2"]}, out
+ assert sorted(out["remembered"]) == ["g-1", "g-2"], out
+
+
+def test_the_search_page_shows_the_refused_groups_with_a_way_in():
+ source = search_source()
+ start = source.index("lanBlocked.length > 0")
+ hint = source[start:start + 400]
+ assert "t('search.lan_blocked'" in hint and "groupLinkRoute(g)" in hint