From a85e6a0c689a40b8788294a2828418b616824118 Mon Sep 17 00:00:00 2001 From: davigonz Date: Mon, 3 Jun 2019 13:52:27 +0200 Subject: [PATCH] Remove loading tests --- .../ui/usecases/CreatePublicShareTest.kt | 33 ------------------ .../shares/ui/usecases/EditPublicShareTest.kt | 34 ------------------- 2 files changed, 67 deletions(-) diff --git a/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/CreatePublicShareTest.kt b/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/CreatePublicShareTest.kt index c743014f4b1..8b580e6d26e 100644 --- a/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/CreatePublicShareTest.kt +++ b/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/CreatePublicShareTest.kt @@ -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 diff --git a/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/EditPublicShareTest.kt b/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/EditPublicShareTest.kt index 25ddc1369f3..fce494726f4 100644 --- a/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/EditPublicShareTest.kt +++ b/owncloudApp/src/androidTest/java/com/owncloud/android/shares/ui/usecases/EditPublicShareTest.kt @@ -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