fix(chat): open the selected history session (#856)

This commit is contained in:
AlexDev_
2026-08-08 23:38:07 +03:00
committed by GitHub
parent adde03a4de
commit 98b35ca8bf
2 changed files with 11 additions and 32 deletions
@@ -1278,9 +1278,17 @@ class ChatViewModelTest {
// ── Session switch ───────────────────────────────────────────────────────
@Test
fun testSwitchSession() =
fun testSwitchSession_opensSelectedHistorySessionInsteadOfLatestDescendant() =
runTest {
val (viewModel, sessionId) = createViewModelWithSession()
coEvery { ApiClient.hermesApi.getLatestDescendant("session-456") } returns
retrofit2.Response.success(
com.m57.hermescontrol.data.model.LatestDescendantResponse(
requested_session_id = "session-456",
session_id = "unrelated-descendant",
changed = true,
),
)
viewModel.switchSession("session-456")
advanceUntilIdle()