From cfe178a0cd817f5ec747c220d37a82d3c7ecbf64 Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Sat, 4 Apr 2026 01:59:04 +0000 Subject: test(smoke): ensure isTesting flag is set before Activity launch - Use BeforeClass to set isTesting in NavApplication - This ensures MapLibre is bypassed correctly even when ActivityScenarioRule starts before @Before. Co-Authored-By: Gemini CLI --- .../androidTest/kotlin/org/terst/nav/MainActivitySmokeTest.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'android-app/app/src/androidTest') diff --git a/android-app/app/src/androidTest/kotlin/org/terst/nav/MainActivitySmokeTest.kt b/android-app/app/src/androidTest/kotlin/org/terst/nav/MainActivitySmokeTest.kt index fecd9cc..30841c7 100644 --- a/android-app/app/src/androidTest/kotlin/org/terst/nav/MainActivitySmokeTest.kt +++ b/android-app/app/src/androidTest/kotlin/org/terst/nav/MainActivitySmokeTest.kt @@ -24,11 +24,20 @@ import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) class MainActivitySmokeTest { + companion object { + @org.junit.BeforeClass + @JvmStatic + fun setUpClass() { + NavApplication.isTesting = true + } + } + @get:Rule val activityRule = ActivityScenarioRule(MainActivity::class.java) @Before fun setup() { + // Redundant but safe NavApplication.isTesting = true } -- cgit v1.2.3