Skip to content

Commit

Permalink
Additional test case and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Jäckel committed Apr 1, 2021
1 parent 749b2d7 commit d364900
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class ButtonStateHelper(
!isRejection && !hasBeenRejected && !needsExecution -> {
true
}
needsExecution && !canReject && !needsYourConfirmation-> {
false
}
!isRejection && !needsYourConfirmation && hasBeenRejected && needsExecution -> {
true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,26 @@ class ButtonStateHelperTest {
assertFalse(buttonStateHelper.confirmButtonIsEnabled())
assertFalse(buttonStateHelper.buttonContainerIsVisible())
}

@Test
fun `(issue #1346) when (needsExecution & !canReject & !needsYourConfirmation) should hide both buttons`() {
val buttonStateHelper =
ButtonStateHelper(
isRejection = false,
needsYourConfirmation = false,
hasBeenRejected = true,
needsExecution = true,
canReject = false,
isOwner = true,
completed = false
)

assertFalse(buttonStateHelper.confirmButtonIsVisible())
assertFalse(buttonStateHelper.buttonContainerIsVisible())
assertFalse(buttonStateHelper.rejectButtonIsVisible())
assertFalse(buttonStateHelper.rejectButtonIsEnabled())
assertFalse(buttonStateHelper.spacerIsVisible())
assertFalse(buttonStateHelper.confirmButtonIsEnabled())
}

}

0 comments on commit d364900

Please sign in to comment.