Skip to content
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

Remove filter on postal codes when switching away from US #4385

Merged
merged 3 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class PostalCodeEditText @JvmOverloads constructor(
updateHint(R.string.address_label_postal_code)
keyListener = TextKeyListener.getInstance()
inputType = InputType.TYPE_TEXT_VARIATION_POSTAL_ADDRESS
filters = arrayOf()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@ class PostalCodeEditTextTest {
.isEqualTo("12345")
}

@Test
fun changing_from_Us_to_other_country_should_allow_longer_postal() {
postalCodeEditText.config = PostalCodeEditText.Config.US
postalCodeEditText.setText("123456")
assertThat(postalCodeEditText.postalCode)
.isEqualTo("12345")

postalCodeEditText.config = PostalCodeEditText.Config.Global
postalCodeEditText.setText("123456")
assertThat(postalCodeEditText.postalCode)
.isEqualTo("123456")
}

@Test
fun updateHint_whenTextInputLayoutHintEnabled_shouldSetHintOnTextInputLayout() {
createActivity {
Expand Down