diff --git a/app/src/androidTest/java/com/afternote/afternote_fe/AppAndReceiverCompletionAndroidTest.kt b/app/src/androidTest/java/com/afternote/afternote_fe/AppAndReceiverCompletionAndroidTest.kt index a189d01769..81a1ab0646 100644 --- a/app/src/androidTest/java/com/afternote/afternote_fe/AppAndReceiverCompletionAndroidTest.kt +++ b/app/src/androidTest/java/com/afternote/afternote_fe/AppAndReceiverCompletionAndroidTest.kt @@ -98,6 +98,15 @@ import com.afternote.feature.home.presentation.R as HomeR import com.afternote.feature.onboarding.presentation.R as OnboardingR import com.afternote.feature.receiver.presentation.R as ReceiverR +/** 이 테스트의 관심 밖인 외부 라우팅을 채우는 no-op 묶음. */ +private val noopActions = + ReceiverHomeActions( + onSettingClick = {}, + onNavigateToMindRecord = {}, + onNavigateToTimeLetter = {}, + onNavigateToAfternote = {}, + ) + @HiltAndroidTest @RunWith(AndroidJUnit4::class) @OptIn(ExperimentalTestApi::class) @@ -287,7 +296,7 @@ class ReceiverRuntimeCompletionAndroidTest { ReceiverHomeScreen( uiState = uiState, onEvent = viewModel::onEvent, - actions = ReceiverHomeActions.Noop, + actions = noopActions, ) } } diff --git a/feature/receiver/presentation/src/main/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeActions.kt b/feature/receiver/presentation/src/main/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeActions.kt index 60fd1444b2..3ff50f34c3 100644 --- a/feature/receiver/presentation/src/main/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeActions.kt +++ b/feature/receiver/presentation/src/main/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeActions.kt @@ -6,12 +6,8 @@ package com.afternote.feature.receiver.presentation.home * 데이터 로드/다운로드는 ViewModel이 관할하고, 외부 화면 이동만 호출 측이 채운다. */ data class ReceiverHomeActions( - val onSettingClick: () -> Unit = {}, - val onNavigateToMindRecord: () -> Unit = {}, - val onNavigateToTimeLetter: () -> Unit = {}, - val onNavigateToAfternote: () -> Unit = {}, -) { - companion object { - val Noop = ReceiverHomeActions() - } -} + val onSettingClick: () -> Unit, + val onNavigateToMindRecord: () -> Unit, + val onNavigateToTimeLetter: () -> Unit, + val onNavigateToAfternote: () -> Unit, +) diff --git a/feature/receiver/presentation/src/screenshotTest/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeScreenScreenshotTest.kt b/feature/receiver/presentation/src/screenshotTest/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeScreenScreenshotTest.kt index d31708a735..cdfa46db39 100644 --- a/feature/receiver/presentation/src/screenshotTest/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeScreenScreenshotTest.kt +++ b/feature/receiver/presentation/src/screenshotTest/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeScreenScreenshotTest.kt @@ -9,6 +9,15 @@ import com.afternote.feature.receiver.presentation.home.model.ReceiverHomeUiStat import com.afternote.feature.receiver.presentation.home.model.SenderMessage import com.android.tools.screenshot.PreviewTest +/** baseline 은 화면 픽셀만 본다 — 외부 라우팅은 눌리지 않으므로 빈 액션으로 채운다. */ +private val noopActions = + ReceiverHomeActions( + onSettingClick = {}, + onNavigateToMindRecord = {}, + onNavigateToTimeLetter = {}, + onNavigateToAfternote = {}, + ) + /** * [ReceiverHomeScreen] 의 시각 회귀 baseline — Loading + Success + 부분 실패 세 케이스. * @@ -22,7 +31,7 @@ internal fun receiverHomeScreenLoadingScreenshot() { ReceiverHomeScreen( uiState = ReceiverHomeUiState.Loading, onEvent = {}, - actions = ReceiverHomeActions.Noop, + actions = noopActions, ) } } @@ -54,7 +63,7 @@ internal fun receiverHomeScreenSuccessScreenshot() { ), ), onEvent = {}, - actions = ReceiverHomeActions.Noop, + actions = noopActions, ) } } @@ -75,7 +84,7 @@ internal fun receiverHomeScreenPartialFailureScreenshot() { afternoteIcons = emptyList(), ), onEvent = {}, - actions = ReceiverHomeActions.Noop, + actions = noopActions, ) } } diff --git a/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeDownloadSnackbarTest.kt b/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeDownloadSnackbarTest.kt index ab94cb0335..016c76e5c0 100644 --- a/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeDownloadSnackbarTest.kt +++ b/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeDownloadSnackbarTest.kt @@ -14,6 +14,15 @@ import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config import org.robolectric.annotation.GraphicsMode +/** 이 테스트의 관심 밖인 외부 라우팅을 채우는 no-op 묶음. */ +private val noopActions = + ReceiverHomeActions( + onSettingClick = {}, + onNavigateToMindRecord = {}, + onNavigateToTimeLetter = {}, + onNavigateToAfternote = {}, + ) + /** * 수신자 홈 내려받기 실패 안내의 Snackbar 표출 가드 (#1391). * @@ -57,7 +66,7 @@ class ReceiverHomeDownloadSnackbarTest { download = download, ), onEvent = { }, - actions = ReceiverHomeActions.Noop, + actions = noopActions, ) } } diff --git a/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeHeaderTest.kt b/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeHeaderTest.kt index e5a603be18..4ca6b05018 100644 --- a/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeHeaderTest.kt +++ b/feature/receiver/presentation/src/test/kotlin/com/afternote/feature/receiver/presentation/home/ReceiverHomeHeaderTest.kt @@ -16,6 +16,15 @@ import org.junit.runner.RunWith import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config +/** 이 테스트의 관심 밖인 외부 라우팅을 채우는 no-op 묶음. */ +private val noopActions = + ReceiverHomeActions( + onSettingClick = {}, + onNavigateToMindRecord = {}, + onNavigateToTimeLetter = {}, + onNavigateToAfternote = {}, + ) + /** * 수신자 홈 헤더가 수신자가 실제로 할 수 있는 액션만 두는지 (#613, 시안 4327:73626). * @@ -41,7 +50,7 @@ class ReceiverHomeHeaderTest { ReceiverHomeScreen( uiState = ReceiverHomeUiState.Loading, onEvent = {}, - actions = ReceiverHomeActions(), + actions = noopActions, ) } } @@ -58,7 +67,7 @@ class ReceiverHomeHeaderTest { ReceiverHomeScreen( uiState = ReceiverHomeUiState.Loading, onEvent = {}, - actions = ReceiverHomeActions(onSettingClick = { settingClicks += 1 }), + actions = noopActions.copy(onSettingClick = { settingClicks += 1 }), ) } }