Skip to content

Commit

Permalink
shareFileFolder compatible for federated share
Browse files Browse the repository at this point in the history
  • Loading branch information
saw-jan committed Apr 20, 2021
1 parent 4587da2 commit c8af844
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,8 @@ Feature: Federation Sharing - sharing with users on other cloud storages
Given user "Brian" has been created with default attributes and without skeleton files
And user "Carol" has been created with default attributes and without skeleton files
And user "Alice" has created folder "simple-folder"
And user "Alice" has created folder "simple-folder/sub-folder"
And user "Alice" has created folder "simple-folder/sub-folder/simple-empty-folder"
And user "Alice" has created file "simple-folder/sub-folder/lorem.txt"
And user "Alice" has created folder "simple-folder/simple-empty-folder"
And user "Alice" has created file "simple-folder/lorem.txt"
And user "Alice" has shared folder "simple-folder" with user "Brian"
And user "Brian" has accepted the share "simple-folder" offered by user "Alice"
When the user re-logs in as "Brian" using the webUI
Expand All @@ -355,7 +354,7 @@ Feature: Federation Sharing - sharing with users on other cloud storages
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
| simple-folder | user-indirect |
When the user opens folder "/Shares/simple-folder/sub-folder" directly on the webUI
When the user opens folder "simple-folder" using the webUI
Then the following resources should have share indicators on the webUI
| fileName | expectedIndicators |
| simple-empty-folder | user-direct |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ Feature: Federation Sharing - sharing with users on other cloud storages
Given user "Brian" has been created with default attributes and without skeleton files
And user "Alice" has created folder "simple-folder"
And user "Alice" has created folder "simple-folder/simple-empty-folder"
And user "Alice" has created file "simple-folder/simple-empty-folder/lorem.txt"
And user "Alice" has created file "simple-folder/lorem.txt"
And user "Alice" has shared folder "simple-folder" with user "Brian"
When the user re-logs in as "Brian" using the webUI
And the user opens folder "simple-folder" using the webUI
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/stepDefinitions/filesContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Given('user {string} has uploaded file {string} to {string}', async function(
await webdav.createFile(user, filename, content)
})

Given('user {string} has uploaded file {string} to {string} on remote server', async function(
Given('user {string} has uploaded file {string} to {string} on remote server', function(
user,
source,
filename
Expand Down
4 changes: 4 additions & 0 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ const shareFileFolder = async function(
const permissions = sharingHelper.humanReadablePermissionsToBitmask(permissionString)
params.append('path', elementToShare)
if (receiver) {
if (receiver.endsWith('@%remote_backend_url%')) {
shareType = SHARE_TYPES.federated_cloud_share
receiver = receiver.replace('%remote_backend_url%', client.globals.remote_backend_url)
}
params.append('shareWith', receiver)
}
params.append('shareType', shareType)
Expand Down

0 comments on commit c8af844

Please sign in to comment.