From 0030b5ce5a11ec564a9e3b3fc1f7f4342996bad3 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 17 Oct 2026 13:29:48 +0200 Subject: feat(android): tell the page when the phone changes network Co-Authored-By: Claude Opus 5.5 --- packages/meshbay-hub/tests/test_android_shell.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'packages/meshbay-hub/tests/test_android_shell.py') diff --git a/packages/meshbay-hub/tests/test_android_shell.py b/packages/meshbay-hub/tests/test_android_shell.py index cba4b320..eedc1988 100644 --- a/packages/meshbay-hub/tests/test_android_shell.py +++ b/packages/meshbay-hub/tests/test_android_shell.py @@ -263,6 +263,18 @@ def test_the_local_network_is_asked_for_when_a_group_opens(): assert "lanAsked = true" in asked[1][:200] +def test_the_page_hears_when_the_phone_changes_network(): + """A connection to the node may run over the network the phone just left, + and the page checks it then (transport.js onNetworkChange). Said by an + event that carries nothing about either network.""" + activity = _read(SRC / "MainActivity.kt") + watch = activity.split("private fun watchNetwork()", 1)[1].split("\n override fun ", 1)[0] + assert "override fun onAvailable" in watch + assert "new Event('meshbay-default-network')" in watch + from spa_source import transport_source + assert "'meshbay-default-network'" in transport_source() + + def test_no_backup_carries_the_keys_away(): manifest = _read(APP / "src" / "main" / "AndroidManifest.xml") assert 'android:allowBackup="false"' in manifest -- cgit v1.2.3