mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
5204: Fix unit test UploadMediaPresenterTest.handleImageResult (#5206)
* UploadMediaPresenterTest: fix failing unit tests * change else if to if condition to handle all cases * include errorCodes 68 for duplicate image and 96 for image without exif * optimise if statements * remove redundant cases * modify if statements to cover all cases * simplify all if statements * add removed comment again * remove unused imports
This commit is contained in:
parent
2c7f2d05cd
commit
a116a17e7b
2 changed files with 5 additions and 14 deletions
|
|
@ -154,10 +154,9 @@ class UploadMediaPresenterTest {
|
|||
uploadMediaPresenter.handleImageResult(EMPTY_CAPTION, uploadItem)
|
||||
verify(view).showMessage(ArgumentMatchers.anyInt(), ArgumentMatchers.anyInt())
|
||||
|
||||
//Bad Picture test
|
||||
//Empty Caption test
|
||||
// Bad Picture Test
|
||||
uploadMediaPresenter.handleImageResult(-7, uploadItem)
|
||||
// TODO https://github.com/commons-app/apps-android-commons/issues/5204 verify(view)?.showBadImagePopup(ArgumentMatchers.anyInt(), ArgumentMatchers.eq(uploadItem))
|
||||
verify(view)?.showBadImagePopup(ArgumentMatchers.anyInt(), ArgumentMatchers.eq(uploadItem))
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -229,7 +228,7 @@ class UploadMediaPresenterTest {
|
|||
*/
|
||||
@Test
|
||||
fun handleBadImageBaseTestFileNameExists() {
|
||||
uploadMediaPresenter.handleBadImage(-4, uploadItem)
|
||||
uploadMediaPresenter.handleBadImage(64, uploadItem)
|
||||
verify(view).showDuplicatePicturePopup(uploadItem)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue