-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FX-780] Fix
isValid
initial value for PIN bug (#136)
* Set `isValid = false` in INITIAL_PIN_ELEMENT_STATE See details in this linear ticket: https://linear.app/joinforage/issue/FX-780/fix-isvalid-default-state-in-android-sdk#comment-fdd01c3a --------- Co-authored-by: dleis612 <[email protected]>
- Loading branch information
1 parent
c351e7a
commit 80d3ebf
Showing
3 changed files
with
71 additions
and
3 deletions.
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
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
28 changes: 28 additions & 0 deletions
28
...ndroid/src/test/java/com/joinforage/forage/android/core/element/state/ElementStateTest.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,28 @@ | ||
package com.joinforage.forage.android.core.element.state | ||
|
||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.Test | ||
|
||
class ElementStateTest { | ||
|
||
@Test | ||
fun testInitialPinElementState() { | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.isFocused).isFalse | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.isBlurred).isTrue | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.isEmpty).isTrue | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.isValid).isFalse | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.isComplete).isFalse | ||
assertThat(INITIAL_PIN_ELEMENT_STATE.validationError).isNull() | ||
} | ||
|
||
@Test | ||
fun testInitialPanElementState() { | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.isFocused).isFalse | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.isBlurred).isTrue | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.isEmpty).isTrue | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.isValid).isTrue | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.isComplete).isFalse | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.validationError).isNull() | ||
assertThat(INITIAL_PAN_ELEMENT_STATE.derivedCardInfo).isEqualTo(DerivedCardInfoDto()) | ||
} | ||
} |