-
Notifications
You must be signed in to change notification settings - Fork 25
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
π 3λ¨κ³ - νμκ°μ (μ ν¨μ± κ²μ¬) #92
Open
hyunjung-choi
wants to merge
14
commits into
next-step:hyunjung-choi
Choose a base branch
from
hyunjung-choi:step3
base: hyunjung-choi
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e41fe80
docs: READMEμ ꡬνν κΈ°λ₯ λͺ©λ‘ μΆκ°
hyunjung-choi 63671a6
chore: stringsμ μλ¬ λ©μμ§ μΆκ°
hyunjung-choi b015d5b
docs: README μμ
hyunjung-choi 55de901
refactor: Screen, Component νμΌ λΆλ¦¬
hyunjung-choi 44345fb
refactor: TextField μμ± ν¨μν
hyunjung-choi 867c114
fix: Textfield Row μ κ±°
hyunjung-choi eb49042
fix: SignupTextField νλΌλ―Έν° μμ
hyunjung-choi 07c6269
docs: 2λ¨κ³ νΌλλ°± λ°μ
hyunjung-choi 694090f
docs: Update README
hyunjung-choi b64bae5
test: Add UsernameValidTest
hyunjung-choi af63a41
docs: Update README
hyunjung-choi b64339d
feat: Add EmailTextField
hyunjung-choi 974bbf3
chore: Update string name
hyunjung-choi 0af5786
test: Add testTag
hyunjung-choi 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 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
84 changes: 84 additions & 0 deletions
84
app/src/androidTest/java/nextstep/signup/InputValidationTest.kt
This file contains 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 nextstep.signup | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithTag | ||
import androidx.compose.ui.test.onNodeWithText | ||
import androidx.compose.ui.test.performTextInput | ||
import nextstep.signup.ui.component.EmailTextField | ||
import nextstep.signup.ui.component.UsernameTextField | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class InputValidationTest { | ||
|
||
@get:Rule | ||
val composeTestRule = createComposeRule() | ||
private val username = mutableStateOf("") | ||
private val email = mutableStateOf("") | ||
|
||
@Before | ||
fun setup() { | ||
composeTestRule.setContent { | ||
Column { | ||
UsernameTextField(username = username) | ||
EmailTextField(email = email) | ||
} | ||
} | ||
} | ||
hyunjung-choi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
@Test | ||
fun μ¬μ©μ_μ΄λ¦μ_2μμ_5μμ¬μΌ_νλ€() { | ||
// when | ||
username.value = "κΉμ»΄ν¬μ¦" | ||
|
||
// then | ||
composeTestRule | ||
.onNodeWithText(USERNAME_LENGTH_ERROR) | ||
.assertDoesNotExist() | ||
} | ||
|
||
@Test | ||
fun μ¬μ©μ_μ΄λ¦μ΄_2μμ_5μκ°_μλλ©΄_μλ¬λ©μμ§κ°_λ ΈμΆλλ€() { | ||
// when | ||
username.value = "κΉμ»΄ν¬μ¦μ λλ€" | ||
|
||
// then | ||
composeTestRule | ||
.onNodeWithText(USERNAME_LENGTH_ERROR) | ||
.assertExists() | ||
} | ||
|
||
@Test | ||
fun μ΄λ©μΌ_νμμ΄_μ¬λ°λ₯Έ_κ²½μ°() { | ||
// when | ||
email.value = "[email protected]" | ||
|
||
// then | ||
composeTestRule | ||
.onNodeWithText(EMAIL_ERROR) | ||
.assertDoesNotExist() | ||
} | ||
|
||
@Test | ||
fun μ΄λ©μΌ_νμμ΄_μ¬λ°λ₯΄μ§_μμ_κ²½μ°() { | ||
// when | ||
composeTestRule.onNodeWithTag("emailTextField").performTextInput("compose") | ||
|
||
// then | ||
composeTestRule | ||
.onNodeWithText(EMAIL_ERROR) | ||
.assertExists() | ||
} | ||
|
||
companion object { | ||
private const val USERNAME_LENGTH_ERROR = "μ΄λ¦μ 2~5μμ¬μΌ ν©λλ€." | ||
private const val USERNAME_LETTER_ERROR = "μ΄λ¦μλ μ«μλ κΈ°νΈκ° ν¬ν¨λ μ μμ΅λλ€." | ||
private const val EMAIL_ERROR = "μ΄λ©μΌ νμμ΄ μ¬λ°λ₯΄μ§ μμ΅λλ€." | ||
private const val PASSWORD_LENGTH_ERROR = "λΉλ°λ²νΈλ 8~16μμ¬μΌ ν©λλ€." | ||
private const val PASSWORD_LETTER_ERROR = "λΉλ°λ²νΈλ μλ¬Έκ³Ό μ«μλ₯Ό ν¬ν¨ν΄μΌ ν©λλ€." | ||
private const val PASSWORD_CONFIRM_ERROR = "λΉλ°λ²νΈκ° μΌμΉνμ§ μμ΅λλ€." | ||
} | ||
} |
This file contains 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
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.
mutableStateOfλ₯Ό νμ©ν΄μ μ»΄ν¬λνΈμ κ°μ λ³κ²½ν΄μ£ΌκΈ°λ³΄λ€,
맀 ν μ€νΈλ§λ€ μ μ»΄ν¬λνΈλ₯Ό setContentν΄μ, κ±°κΈ°μ νμν κ°μ μ§μ λ£μ΄μ£Όλ ννλ μ΄λ¨κΉμ?