CountDownActivity Compose 전환 및 테스트 추가#403
Conversation
📝 WalkthroughWalkthroughThe countdown screen now uses Jetpack Compose instead of view binding and XML animation resources. ChangesCompose Countdown Migration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/src/androidTest/java/com/runnect/runnect/presentation/countdown/CountDownScreenTest.kt`:
- Line 30: The countdown test is asserting against hard-coded Korean UI text,
which makes it locale-dependent. Update CountDownScreenTest to locate the
countdown description through CountDownContent’s DESCRIPTION tag and verify it
against the R.string.count_down_desc resource instead of onNodeWithText. Keep
the assertion tied to the existing Compose semantics/tag identifiers so the test
remains stable across locales.
In
`@app/src/main/java/com/runnect/runnect/presentation/countdown/CountDownScreen.kt`:
- Around line 65-73: The countdown logic in CountDownScreen’s
LaunchedEffect(currentCount) keeps ticking even when the activity is not
RESUMED, which can trigger onFinished() while the app is backgrounded. Update
the countdown tick to be lifecycle-aware by tying the delay/nextCount update
flow to the current lifecycle, using repeatOnLifecycle(Lifecycle.State.RESUMED)
or equivalent, so currentCount only advances while the screen is visible and
active.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: d0d5b828-279c-4d4d-988b-2f1daf5d6d2d
📒 Files selected for processing (6)
app/src/androidTest/java/com/runnect/runnect/presentation/countdown/CountDownScreenTest.ktapp/src/main/java/com/runnect/runnect/presentation/countdown/CountDownActivity.ktapp/src/main/java/com/runnect/runnect/presentation/countdown/CountDownScreen.ktapp/src/main/res/anim/anim_count.xmlapp/src/main/res/layout/activity_count_down.xmlapp/src/test/java/com/runnect/runnect/presentation/countdown/CountDownStateMachineTest.kt
💤 Files with no reviewable changes (2)
- app/src/main/res/layout/activity_count_down.xml
- app/src/main/res/anim/anim_count.xml
| composeTestRule.onNodeWithTag(CountDownScreenTestTags.NUMBER) | ||
| .assertIsDisplayed() | ||
| .assertContentDescriptionEquals("3") | ||
| composeTestRule.onNodeWithText("잠시 후 러닝을 시작합니다").assertIsDisplayed() |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Avoid hard-coding localized UI copy in the assertion.
This makes the test locale-dependent even though CountDownContent already exposes a DESCRIPTION tag and reads from R.string.count_down_desc. Assert via the tag plus the string resource instead.
Suggested change
+import androidx.compose.ui.test.assertTextEquals
import androidx.compose.ui.test.assertContentDescriptionEquals
import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithTag
-import androidx.compose.ui.test.onNodeWithText
+import androidx.test.platform.app.InstrumentationRegistry
+import com.runnect.runnect.R
import com.runnect.runnect.presentation.ui.theme.RunnectTheme
@@
fun 카운트다운_배경_숫자_안내문구가_노출된다() {
+ val context = InstrumentationRegistry.getInstrumentation().targetContext
+
composeTestRule.setContent {
RunnectTheme {
CountDownContent(count = 3)
@@
- composeTestRule.onNodeWithText("잠시 후 러닝을 시작합니다").assertIsDisplayed()
+ composeTestRule.onNodeWithTag(CountDownScreenTestTags.DESCRIPTION)
+ .assertIsDisplayed()
+ .assertTextEquals(context.getString(R.string.count_down_desc))
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| composeTestRule.onNodeWithText("잠시 후 러닝을 시작합니다").assertIsDisplayed() | |
| val context = InstrumentationRegistry.getInstrumentation().targetContext | |
| composeTestRule.onNodeWithTag(CountDownScreenTestTags.DESCRIPTION) | |
| .assertIsDisplayed() | |
| .assertTextEquals(context.getString(R.string.count_down_desc)) |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In
`@app/src/androidTest/java/com/runnect/runnect/presentation/countdown/CountDownScreenTest.kt`
at line 30, The countdown test is asserting against hard-coded Korean UI text,
which makes it locale-dependent. Update CountDownScreenTest to locate the
countdown description through CountDownContent’s DESCRIPTION tag and verify it
against the R.string.count_down_desc resource instead of onNodeWithText. Keep
the assertion tied to the existing Compose semantics/tag identifiers so the test
remains stable across locales.
작업 배경
변경 사항
presentation/countdown/CountDownActivityCountDownRoute렌더링 및 완료 시RunActivity이동 처리presentation/countdown/CountDownScreenCountDownStateMachineTestCountDownScreenTestres/layout/activity_count_down.xml,res/anim/anim_count.xml영향 범위
RunActivity진입 흐름CourseDataintent extra 전달과 뒤로가기 analytics/전환 애니메이션은 유지검증 매트릭스
카운트다운은 3에서 시작한다카운트다운은 3_2_1 순서로 진행되고 이후 종료된다•
카운트다운이_끝나면_완료_콜백이_호출된다카운트다운 숫자에 맞는 drawable을 반환한다카운트다운 숫자 애니메이션은 기존 XML scale 범위를 유지한다카운트다운_배경_숫자_안내문구가_노출된다Test Plan
./gradlew testDebugUnitTest --tests 'com.runnect.runnect.presentation.countdown.*'통과: 4/4ANDROID_SERIAL=emulator-5554 ./gradlew connectedDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.runnect.runnect.presentation.countdown.CountDownScreenTest통과: 2/2./gradlew assembleDebug통과Before / After 영상
countdown_before.mp4
countdown_after.mp4
기존 리소스 기반 카운트다운 3→2→1 화면과 Compose 전환 후 카운트다운 3→2→1 화면을 비교했습니다.
🤖 Generated with Claude Code