Repository navigation
fix(home): 조회 전 수신인 지정 배지를 '미완료' 로 확정하지 않는다 (#698) #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
352a0a7
fix(home): 조회 전 수신인 지정 배지를 미완료로 확정하지 않는다
Sadturtleman 504dfa1
test(home): 로딩 배지 변경에 맞춰 스크린샷 baseline 을 갱신한다
Sadturtleman f654c48
fix(home): 미결정 배지를 콘텐츠 없이 자리만 잡는 형태로 바꾼다
Sadturtleman 555a352
test(home): 미결정 배지 렌더 변경에 맞춰 baseline 을 갱신한다
Sadturtleman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-15.9 KB
(98%)
...ion/HomeTabScreenScreenshotTestKt/homeTabScreenLoadingScreenshot_748aa731_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions
84
...tion/src/test/kotlin/com/afternote/feature/home/presentation/RecipientBadgeLoadingTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| package com.afternote.feature.home.presentation | ||
|
|
||
| import androidx.activity.ComponentActivity | ||
| import androidx.compose.ui.test.assertHasNoClickAction | ||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
| import androidx.compose.ui.test.onNodeWithContentDescription | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import com.afternote.core.ui.badge.RecipientDesignationBadge | ||
| import com.afternote.core.ui.badge.RecipientDesignationBadgeState | ||
| import com.afternote.core.ui.theme.AfternoteTheme | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
| import org.robolectric.RobolectricTestRunner | ||
| import org.robolectric.annotation.Config | ||
|
|
||
| /** | ||
| * 조회 전 수신인 지정 배지 (#698). | ||
| * | ||
| * 로딩 분기가 `isRecipientDesignated = false` 를 넘겨, **아직 조회되지 않은 상태를 | ||
| * «미완료» 라는 결과로 단정**했다. 이미 지정한 사용자도 진입할 때마다 그 배지를 보고, | ||
| * 배지가 탭 가능한 CTA 라 하지 않아도 될 행동을 유도했다. | ||
| */ | ||
| @RunWith(RobolectricTestRunner::class) | ||
| @Config(sdk = [35]) | ||
| class RecipientBadgeLoadingTest { | ||
| @get:Rule | ||
| val composeRule = createAndroidComposeRule<ComponentActivity>() | ||
|
|
||
| /** | ||
| * 미결정 배지는 shimmer 가 무한 애니메이션이라 Compose 가 영원히 idle 이 되지 않는다. | ||
| * 시계를 수동으로 돌려 한 프레임만 그린 뒤 읽는다. | ||
| */ | ||
| private fun setUnknownBadge() { | ||
| composeRule.mainClock.autoAdvance = false | ||
| composeRule.setContent { | ||
| AfternoteTheme { RecipientDesignationBadge(state = RecipientDesignationBadgeState.Unknown) } | ||
| } | ||
| composeRule.mainClock.advanceTimeByFrame() | ||
| } | ||
|
|
||
| @Test | ||
| fun `조회 전에는 미완료로 확정하지 않는다`() { | ||
| setUnknownBadge() | ||
|
|
||
| composeRule.onNodeWithText("수신인 지정 미완료").assertDoesNotExist() | ||
| composeRule.onNodeWithText("수신인 지정 완료").assertDoesNotExist() | ||
| } | ||
|
|
||
| @Test | ||
| fun `조회 전 배지는 눌리지 않고 문구도 그리지 않는다`() { | ||
| // 미결정 상태에서 CTA 를 노출하면 하지 않아도 될 행동을 유도한다. 문구 자체도 | ||
| // 그리지 않는다 — 시안에 없는 안내가 홈 첫 화면에 뜨면 그것대로 확정된 무언가로 | ||
| // 읽힌다. 읽을 것은 접근성으로만 준다. | ||
| setUnknownBadge() | ||
|
|
||
| composeRule.onNodeWithText("수신인 지정 여부 확인 중").assertDoesNotExist() | ||
| composeRule | ||
| .onNodeWithContentDescription("수신인 지정 여부 확인 중") | ||
| .assertHasNoClickAction() | ||
| } | ||
|
|
||
| @Test | ||
| fun `홈 로딩 분기가 미완료 배지를 그리지 않는다`() { | ||
| // 컴포넌트만 고쳐도 화면이 여전히 false 를 넘기면 증상이 그대로 남는다 — 배선까지 본다. | ||
| composeRule.mainClock.autoAdvance = false | ||
| composeRule.setContent { | ||
| AfternoteTheme { HomeTabScreen(uiState = HomeTabUiState.Loading()) } | ||
| } | ||
| composeRule.mainClock.advanceTimeByFrame() | ||
|
|
||
| composeRule.onNodeWithText("수신인 지정 미완료").assertDoesNotExist() | ||
| } | ||
|
|
||
| @Test | ||
| fun `조회가 끝나면 결과를 그대로 보여준다`() { | ||
| composeRule.setContent { | ||
| AfternoteTheme { RecipientDesignationBadge(state = RecipientDesignationBadgeState.Completed) } | ||
| } | ||
|
|
||
| composeRule.onNodeWithText("수신인 지정 완료").assertIsDisplayed() | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] 확정 상태 칩은 고정 크기가 아니라 콘텐츠 wrap +
padding(horizontal = 15.dp, vertical = 9.dp)입니다(CircularCheckboxOutlineChip.kt:55). 그래서 이 132×36 은 «지금 이 폰트 크기에서 잰 한 시점의 값» 입니다.두 가지가 걸립니다.
수신인 지정 완료)와 미완료(수신인 지정 미완료+ 후행 화살표)의 폭이 서로 다른데, 자리표시자는 하나의 고정값이라 어느 쪽으로 전환돼도 폭이 한 번 튑니다.지금 값이 틀렸다는 건 아니고, 칩 라벨이 바뀌거나 타이포가 조정되면 조용히 어긋나는 종류라 «실측값 상수» 로 굳히기보다 칩과 같은 계산을 타게 하는 편이 안전합니다. 예를 들어 확정 상태 칩을
alpha = 0f로 그려 자리만 차지하게 하면 padding·타이포·폰트 스케일이 자동으로 따라옵니다.후속으로 보셔도 됩니다 — 승인 자체를 막을 사안은 아닙니다.