From 0375eef9358e622be3dd8d3fca274c8cea0e3da6 Mon Sep 17 00:00:00 2001 From: Ochenstarik Date: Tue, 25 Aug 2026 10:11:17 +0700 Subject: [PATCH] test: seed host in ChatViewModelScopeTest Before setup --- .../feature/chat/ChatViewModelScopeTest.kt | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/androidTest/java/app/hermes/mobile/feature/chat/ChatViewModelScopeTest.kt b/app/src/androidTest/java/app/hermes/mobile/feature/chat/ChatViewModelScopeTest.kt index 1756800..918098c 100644 --- a/app/src/androidTest/java/app/hermes/mobile/feature/chat/ChatViewModelScopeTest.kt +++ b/app/src/androidTest/java/app/hermes/mobile/feature/chat/ChatViewModelScopeTest.kt @@ -6,8 +6,14 @@ import androidx.compose.ui.test.onAllNodesWithText import androidx.compose.ui.test.onNodeWithText import androidx.compose.ui.test.performClick import androidx.compose.ui.test.performTextInput +import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 +import app.hermes.mobile.HermesApplication import app.hermes.mobile.MainActivity +import app.hermes.mobile.core.model.HermesHost +import app.hermes.mobile.core.model.HermesHostId +import kotlinx.coroutines.runBlocking +import org.junit.Before import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith @@ -18,6 +24,20 @@ class ChatViewModelScopeTest { @get:Rule val composeTestRule = createAndroidComposeRule() + @Before + fun setup() { + val app = ApplicationProvider.getApplicationContext() + runBlocking { + app.container.connectionManager.addHost( + HermesHost( + id = HermesHostId("test-host-id"), + displayName = "Test Host", + baseUrl = "http://127.0.0.1:9119" + ) + ) + } + } + @Test fun testChatStateSurvivesRecreation() { // Wait for New Session button and click