Repository navigation
fix(app): 수신자 홈 기록 수 실패를 개수 자리 대시로 표기 (#952) #1020
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
3 commits
Select commit
Hold shift + click to select a range
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
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
+14.3 KB
(110%)
...creenScreenshotTestKt/receiverHomeScreenPartialFailureScreenshot_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.
69 changes: 69 additions & 0 deletions
69
...m/afternote/feature/receiver/presentation/home/component/ReceiverHomeCountFallbackTest.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,69 @@ | ||
| package com.afternote.feature.receiver.presentation.home.component | ||
|
|
||
| import androidx.activity.ComponentActivity | ||
| import androidx.compose.ui.test.assertCountEquals | ||
| import androidx.compose.ui.test.assertIsDisplayed | ||
| import androidx.compose.ui.test.junit4.createAndroidComposeRule | ||
| import androidx.compose.ui.test.onAllNodesWithText | ||
| import androidx.compose.ui.test.onNodeWithText | ||
| import com.afternote.core.ui.theme.AfternoteTheme | ||
| import com.afternote.feature.receiver.presentation.home.model.MindRecordSummary | ||
| import org.junit.Rule | ||
| import org.junit.Test | ||
| import org.junit.runner.RunWith | ||
| import org.robolectric.RobolectricTestRunner | ||
| import org.robolectric.annotation.Config | ||
|
|
||
| /** | ||
| * 기록 수 조회 실패 표기 (#952, 시안 4309:19394). | ||
| * | ||
| * 확정값은 «개수 자리만 대시, 레이아웃은 유지» 다. 종전에는 문장을 통째로 "기록 수를 | ||
| * 불러오지 못했습니다." 로 갈아 끼우고 통계 카드 행을 숨겨, 실패한 화면과 정상 화면의 | ||
| * 구성이 달랐다 — 카드가 통째로 사라지면 «기능이 없는 것» 과 «못 불러온 것» 도 | ||
| * 구분되지 않는다. | ||
| */ | ||
| @RunWith(RobolectricTestRunner::class) | ||
| @Config(sdk = [35]) | ||
| class ReceiverHomeCountFallbackTest { | ||
| @get:Rule | ||
| val composeRule = createAndroidComposeRule<ComponentActivity>() | ||
|
|
||
| @Test | ||
| fun `조회에 실패해도 문장 구조가 그대로다`() { | ||
| composeRule.setContent { | ||
| AfternoteTheme { MindRecordSection(summary = null, onGoClick = {}) } | ||
| } | ||
|
|
||
| // 종전 문구가 아니라, 개수 자리만 바뀐 같은 문장이어야 한다. | ||
| composeRule.onNodeWithText("–개 마음의 기록이 있습니다.").assertIsDisplayed() | ||
| } | ||
|
|
||
| @Test | ||
| fun `조회에 실패해도 통계 카드가 남는다`() { | ||
| composeRule.setContent { | ||
| AfternoteTheme { MindRecordSection(summary = null, onGoClick = {}) } | ||
| } | ||
|
|
||
| composeRule.onNodeWithText("데일리 질문").assertIsDisplayed() | ||
| composeRule.onNodeWithText("일기").assertIsDisplayed() | ||
| // 두 카드의 개수 자리가 «모두» 대시다 — 인덱스 하나만 보면 한 장만 대시로 남는 | ||
| // 회귀를 놓치고, 노드 순서가 바뀌면 조용히 다른 것을 본다. | ||
| composeRule.onAllNodesWithText("–").assertCountEquals(2) | ||
| } | ||
|
|
||
| @Test | ||
| fun `정상 조회는 숫자를 그대로 보여준다`() { | ||
| composeRule.setContent { | ||
| AfternoteTheme { | ||
| MindRecordSection( | ||
| summary = MindRecordSummary(dailyQuestionCount = 18, diaryCount = 4), | ||
| onGoClick = {}, | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| composeRule.onNodeWithText("22개 마음의 기록이 있습니다.").assertIsDisplayed() | ||
| composeRule.onNodeWithText("18").assertIsDisplayed() | ||
| composeRule.onNodeWithText("4").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] 이름이 아주 일반적인데(
countText) 패키지 레벨public입니다. 같은 패키지의 다른 화면에서 «개수를 문자열로» 정도의 뜻으로 끌어다 쓰면, 실제로는 «수신자 홈의 조회 실패 표기 규칙» 이 딸려 옵니다.internal로 좁히거나 이름에 맥락을 넣으면(countOrDash류) 오용 여지가 줄어듭니다. 지금 범위에서 문제가 생기는 건 아니니 후속으로 보셔도 됩니다.