From 90e346a0e54b9f86bc5d7122101f6ddca002f3e2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Sep 2026 14:00:14 +0000 Subject: [PATCH] fix(test): resolve the playback-error description outside composition be7be5b6 dropped the Context argument from the description lookup in PlaybackErrorOverlayFitTest, which turned it into a call to the @Composable stringRes overload from a plain test function, so the androidTest source set stopped compiling. Load it with loadStringRes in runBlocking, like the test's other lookups, and drop the now-unused targetContext. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BkG4KTqmnprUK9BAcwAyc8 --- .../composable/PlaybackErrorOverlayFitTest.kt | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/amethyst/src/androidTest/java/com/vitorpamplona/amethyst/service/playback/composable/PlaybackErrorOverlayFitTest.kt b/amethyst/src/androidTest/java/com/vitorpamplona/amethyst/service/playback/composable/PlaybackErrorOverlayFitTest.kt index ae3095d27e..1b86d61661 100644 --- a/amethyst/src/androidTest/java/com/vitorpamplona/amethyst/service/playback/composable/PlaybackErrorOverlayFitTest.kt +++ b/amethyst/src/androidTest/java/com/vitorpamplona/amethyst/service/playback/composable/PlaybackErrorOverlayFitTest.kt @@ -39,13 +39,11 @@ import androidx.compose.ui.unit.dp import androidx.media3.common.PlaybackException import androidx.media3.common.Player import androidx.test.ext.junit.runners.AndroidJUnit4 -import androidx.test.platform.app.InstrumentationRegistry import com.vitorpamplona.amethyst.commons.resources.Res import com.vitorpamplona.amethyst.commons.resources.error_video_open_in_browser import com.vitorpamplona.amethyst.commons.resources.error_video_playback_failed import com.vitorpamplona.amethyst.commons.resources.error_video_playback_failed_description import com.vitorpamplona.amethyst.commons.ui.loadStringRes -import com.vitorpamplona.amethyst.commons.ui.stringRes import io.mockk.mockk import kotlinx.coroutines.runBlocking import org.junit.Assert.assertTrue @@ -70,8 +68,6 @@ class PlaybackErrorOverlayFitTest { @get:Rule val rule = createComposeRule() - private val targetContext = InstrumentationRegistry.getInstrumentation().targetContext - /** * Built outside composition on purpose: the mock and its error state are fixtures for the whole * test, not per-composition state. Creating them inside `setContent` would rebuild both on every @@ -141,10 +137,12 @@ class PlaybackErrorOverlayFitTest { assertButtonUsable() rule .onNodeWithText( - stringRes( - Res.string.error_video_playback_failed_description, - "ERROR_CODE_PARSING_MANIFEST_MALFORMED", - ), + runBlocking { + loadStringRes( + Res.string.error_video_playback_failed_description, + "ERROR_CODE_PARSING_MANIFEST_MALFORMED", + ) + }, ).assertDoesNotExist() }