Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
devinmorgan committed Dec 5, 2023
1 parent 4e713ff commit 8ed83f1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ internal val INITIAL_PIN_ELEMENT_STATE = PinElementStateDto(
isFocused = false,
isBlurred = true,
isEmpty = true,
isValid = true,
isValid = false,
isComplete = false,
validationError = null
)
Expand Down Expand Up @@ -58,7 +58,7 @@ internal val INITIAL_PAN_ELEMENT_STATE = PanElementStateDto(
isFocused = false,
isBlurred = true,
isEmpty = true,
isValid = false,
isValid = true,
isComplete = false,
validationError = null,
derivedCardInfo = DerivedCardInfoDto()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class ElementStateManagerTest {
assertThat(state.isValid).isEqualTo(INITIAL_PIN_ELEMENT_STATE.isValid)
assertThat(state.isComplete).isEqualTo(INITIAL_PIN_ELEMENT_STATE.isComplete)
assertThat(state.validationError).isEqualTo(INITIAL_PIN_ELEMENT_STATE.validationError)
// cast to Any? to avoid ambiguous overload issue that
// is unique to PinDetails because it's an alias for `Nothing?`
assertThat(state.details as Any?).isEqualTo(INITIAL_PIN_ELEMENT_STATE.details)
}

@Test
Expand Down Expand Up @@ -113,10 +110,7 @@ class ElementStateManagerTest {
assertThat(state.isEmpty).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isEmpty)
assertThat(state.isValid).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isValid)
assertThat(state.isComplete).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isComplete)

// cast to Any? to avoid ambiguous overload issue that
// is unique to PinDetails because it's an alias for `Nothing?`
assertThat(state.details as Any?).isEqualTo(INITIAL_PAN_ELEMENT_STATE.details)
assertThat(state.derivedCardInfo).isEqualTo(INITIAL_PAN_ELEMENT_STATE.derivedCardInfo)

// unfocus
manager.changeFocus(false)
Expand All @@ -126,9 +120,6 @@ class ElementStateManagerTest {
assertThat(state.isEmpty).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isEmpty)
assertThat(state.isValid).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isValid)
assertThat(state.isComplete).isEqualTo(INITIAL_PAN_ELEMENT_STATE.isComplete)

// cast to Any? to avoid ambiguous overload issue that
// is unique to PinDetails because it's an alias for `Nothing?`
assertThat(state.details as Any?).isEqualTo(INITIAL_PAN_ELEMENT_STATE.details)
assertThat(state.derivedCardInfo).isEqualTo(INITIAL_PAN_ELEMENT_STATE.derivedCardInfo)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ class ElementStateTest {
assertThat(INITIAL_PIN_ELEMENT_STATE.isValid).isFalse
assertThat(INITIAL_PIN_ELEMENT_STATE.isComplete).isFalse
assertThat(INITIAL_PIN_ELEMENT_STATE.validationError).isNull()

// cast to Any? to avoid ambiguous overload issue that
// is unique to PinDetails because it's an alias for `Nothing?`
assertThat(INITIAL_PIN_ELEMENT_STATE.details as Any?).isNull()
}

@Test
Expand All @@ -27,6 +23,6 @@ class ElementStateTest {
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.details).isEqualTo(PanDetails(DerivedCardInfo()))
assertThat(INITIAL_PAN_ELEMENT_STATE.derivedCardInfo).isEqualTo(DerivedCardInfoDto())
}
}

0 comments on commit 8ed83f1

Please sign in to comment.