Skip to content

Commit

Permalink
Fix some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davigonz committed Aug 5, 2019
1 parent b2bbf26 commit 63e74e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ class EditPublicShareTest {
calendar.add(Calendar.DAY_OF_YEAR, 1)
val formatter: DateFormat = SimpleDateFormat("MMM dd, yyyy");
val expirationDate = formatter.format(calendar.time);
val publicLinkExpirationDateInMillis = SimpleDateFormat.getDateInstance().parse(expirationDate).time
val publicLinkExpirationDateInMillis = formatter.parse(expirationDate).time

// 1. Open dialog to edit an existing public share
onView(withId(R.id.editPublicLinkButton)).perform(click())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ class ShareFileFragment : Fragment(), ShareUserListAdapter.ShareUserAdapterListe
/**
* @return 'True' when public share is disabled in the server
*/
private val isPublicShareDisabled: Boolean
get() = capabilities?.filesSharingPublicEnabled == CapabilityBooleanType.FALSE.value
private val isPublicShareEnabled: Boolean
get() = capabilities?.filesSharingPublicEnabled == CapabilityBooleanType.TRUE.value ||
capabilities?.filesSharingPublicEnabled == CapabilityBooleanType.UNKNOWN.value

/**
* {@inheritDoc}
Expand Down Expand Up @@ -329,9 +330,7 @@ class ShareFileFragment : Fragment(), ShareUserListAdapter.ShareUserAdapterListe
// Update view depending on updated capabilities
shareHeaderDivider.isVisible = isShareApiEnabled
shareWithUsersSection.isVisible = isShareApiEnabled
shareViaLinkSection.isVisible = isShareApiEnabled

shareViaLinkSection.isGone = isPublicShareDisabled
shareViaLinkSection.isVisible = isShareApiEnabled && isPublicShareEnabled
}

/**************************************************************************************************************
Expand Down

0 comments on commit 63e74e3

Please sign in to comment.