Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tillh-stripe committed Sep 13, 2022
1 parent 5b6dc50 commit e8420f7
Showing 1 changed file with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,14 @@ class ExpiryDateEditTextTest {
}

@Test
fun afterInputThreeDigits_whenDeletingOne_textDoesContainSlash() {
fun afterInputThreeDigits_whenDeletingOne_textDoesNotContainSlash() {
expiryDateEditText.append("1")
expiryDateEditText.append("2")
expiryDateEditText.append("3")

ViewTestUtils.sendDeleteKeyEvent(expiryDateEditText)
assertThat(expiryDateEditText.text.toString())
.isEqualTo("12/")
.isEqualTo("12")
}

@Test
Expand Down Expand Up @@ -213,14 +213,14 @@ class ExpiryDateEditTextTest {
}

@Test
fun delete_whenAcrossSeparator_deletesSeparator() {
fun delete_whenAcrossSeparator_deletesSeparatorAndLastCharacterBeforeSeparator() {
expiryDateEditText.append("12")
assertThat(expiryDateEditText.text.toString())
.isEqualTo("12/")

ViewTestUtils.sendDeleteKeyEvent(expiryDateEditText)
assertThat(expiryDateEditText.text.toString())
.isEqualTo("12")
.isEqualTo("1")
}

@Test
Expand Down Expand Up @@ -376,15 +376,7 @@ class ExpiryDateEditTextTest {

ViewTestUtils.sendDeleteKeyEvent(expiryDateEditText)
assertThat(expiryDateEditText.fieldText)
.isEqualTo("12 / ")

ViewTestUtils.sendDeleteKeyEvent(expiryDateEditText)
assertThat(expiryDateEditText.fieldText)
.isEqualTo("12 /")

ViewTestUtils.sendDeleteKeyEvent(expiryDateEditText)
assertThat(expiryDateEditText.fieldText)
.isEqualTo("12 ")
.isEqualTo("12")
}

@Test
Expand Down

0 comments on commit e8420f7

Please sign in to comment.