Skip to content

Commit

Permalink
Merge pull request #10320 from wordpress-mobile/fix-unit-tests
Browse files Browse the repository at this point in the history
Fix PostListItemUiStateHelper unit tests
  • Loading branch information
maxme authored Aug 2, 2019
2 parents 585a65d + 0318ebf commit 1e8617f
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,16 +238,9 @@ class PostListItemUiStateHelperTest {
post = createPostModel(status = POST_STATE_TRASHED)
)

assertThat(state.actions[0].buttonType).isEqualTo(PostListButtonType.BUTTON_EDIT)
assertThat(state.actions[1].buttonType).isEqualTo(PostListButtonType.BUTTON_VIEW)
assertThat(state.actions[2].buttonType).isEqualTo(PostListButtonType.BUTTON_MORE)
assertThat(state.actions).hasSize(3)

assertThat((state.actions[2] as MoreItem).actions[0].buttonType)
.isEqualTo(PostListButtonType.BUTTON_DELETE)
assertThat((state.actions[2] as MoreItem).actions[1].buttonType)
.isEqualTo(PostListButtonType.BUTTON_MOVE_TO_DRAFT)
assertThat((state.actions[2] as MoreItem).actions).hasSize(2)
assertThat(state.actions[0].buttonType).isEqualTo(PostListButtonType.BUTTON_MOVE_TO_DRAFT)
assertThat(state.actions[1].buttonType).isEqualTo(PostListButtonType.BUTTON_DELETE_PERMANENTLY)
assertThat(state.actions).hasSize(2)
}

@Test
Expand Down Expand Up @@ -537,7 +530,7 @@ class PostListItemUiStateHelperTest {
uploadStatus = createUploadStatus(uploadError = UploadError(MediaError(MediaErrorType.GENERIC_ERROR)))
)
assertThat(state.actions[0].buttonType).isEqualTo(PostListButtonType.BUTTON_EDIT)
assertThat(state.actions[1].buttonType).isEqualTo(PostListButtonType.BUTTON_SUBMIT)
assertThat(state.actions[1].buttonType).isEqualTo(PostListButtonType.BUTTON_RETRY)
assertThat(state.actions[2].buttonType).isEqualTo(PostListButtonType.BUTTON_DELETE)
assertThat(state.actions).hasSize(3)
}
Expand Down

0 comments on commit 1e8617f

Please sign in to comment.