Skip to content

Commit

Permalink
Remove loading tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davigonz committed Jun 3, 2019
1 parent c4becd4 commit a85e6a0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -261,39 +261,6 @@ class CreatePublicShareTest {
onView(withText(newPublicShare3.name)).check(matches(isDisplayed()))
}

@Test
fun loadingCreateShares(){

loadCapabilitiesSuccessfully()
loadSharesSuccessfully(arrayListOf())

val newPublicShare = publicShares[0]

`when`(
ocShareViewModel.insertPublicShareForFile(
1,
newPublicShare.name!!,
"",
-1,
false
)
).thenReturn(sharesLiveData)

// 1. Open dialog to create new public share
onView(withId(R.id.addPublicLinkButton)).perform(click())

// 2. Save share
onView(withId(R.id.saveButton)).perform(click())

sharesLiveData.postValue(
Resource.loading(
arrayListOf(newPublicShare)
)
)

onView(withText(R.string.common_loading)).check(matches(isDisplayed()))
}

private fun getOCFileForTesting(name: String = "default") = OCFile("/Photos").apply {
availableOfflineStatus = OCFile.AvailableOfflineStatus.NOT_AVAILABLE_OFFLINE
fileName = name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,40 +427,6 @@ class EditPublicShareTest {
onView(withId(R.id.shareViaLinkExpirationSwitch)).check(matches(isNotChecked()))
}

@Test
fun loadingEditShares(){
loadCapabilitiesSuccessfully()

val existingPublicShare = publicShares[0]
loadSharesSuccessfully(arrayListOf(existingPublicShare))

val updatedPublicShare = publicShares[1]

`when`(
ocShareViewModel.updatePublicShareForFile(
1,
updatedPublicShare.name!!,
"",
-1,
1,
false
)
).thenReturn(sharesLiveData)

//Edit name is performed
onView(withId(R.id.editPublicLinkButton)).perform(click())
onView(withId(R.id.shareViaLinkNameValue)).perform(replaceText(updatedPublicShare.name))
onView(withId(R.id.saveButton)).perform(click())

sharesLiveData.postValue(
Resource.loading(
arrayListOf(updatedPublicShare)
)
)

onView(withText(R.string.common_loading)).check(matches(isDisplayed()))
}

private fun getOCFileForTesting(name: String = "default") = OCFile("/Photos").apply {
availableOfflineStatus = OCFile.AvailableOfflineStatus.NOT_AVAILABLE_OFFLINE
fileName = name
Expand Down

0 comments on commit a85e6a0

Please sign in to comment.