From a7127e127f2ebe031301fbd507e2c6911fbcb73a Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 27 May 2026 23:32:14 -0400 Subject: [PATCH] test(android): LibraryViewModelTest expects ErrorCopy generic fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The error test asserted the raw exception text leaked into the UI state — exactly the behaviour ErrorCopy removes. An IllegalStateException is neither HttpException nor IOException, so it maps to the generic "Something went wrong." Updated the assertion to the new contract and dropped the now-unused assertTrue import. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../fabledsword/minstrel/library/ui/LibraryViewModelTest.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/app/src/test/java/com/fabledsword/minstrel/library/ui/LibraryViewModelTest.kt b/android/app/src/test/java/com/fabledsword/minstrel/library/ui/LibraryViewModelTest.kt index 19570367..a78d0097 100644 --- a/android/app/src/test/java/com/fabledsword/minstrel/library/ui/LibraryViewModelTest.kt +++ b/android/app/src/test/java/com/fabledsword/minstrel/library/ui/LibraryViewModelTest.kt @@ -16,7 +16,6 @@ import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith import kotlin.test.assertEquals -import kotlin.test.assertTrue @ExtendWith(MainDispatcherExtension::class) class LibraryViewModelTest { @@ -100,7 +99,9 @@ class LibraryViewModelTest { vm.uiState.test { val error = awaitItem() as LibraryUiState.Error - assertTrue(error.message.contains("DAO blew up")) + // ErrorCopy maps a non-HTTP/non-IO throwable to the generic + // fallback rather than leaking the raw exception text. + assertEquals("Something went wrong.", error.message) cancelAndConsumeRemainingEvents() } }