Skip to content

Commit

Permalink
Modified create share step impl. to support +- days in expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
kiranparajuli589 committed Mar 11, 2020
1 parent 340abbc commit 824b1ed
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ Feature: Sharing files and folders with internal groups
| path | lorem.txt |
| shareTypeString | group |
| shareWith | grp1 |
| expireDate | 2038-10-12 |
| expireDate | +14 |
And user "user3" has logged in using the webUI
When the user edits share with group "grp1" of file "lorem.txt" changing following
| expireDate | +7 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ Feature: Sharing files and folders with internal users
Given user "user1" has created a new share with following settings
| path | lorem.txt |
| shareWith | user2 |
| expireDate | 2038-10-12 |
| expireDate | +14 |
And user "user1" has logged in using the webUI
When the user edits share with user "User Two" of file "lorem.txt" changing following
| expireDate | +7 |
Expand Down
12 changes: 8 additions & 4 deletions tests/acceptance/stepDefinitions/sharingContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,15 @@ const shareFileFolder = function (
Given('user {string} has created a new share with following settings',
function (sharer, dataTable) {
const settings = dataTable.rowsHash()
let expireDate = settings.expireDate
const expireDate = settings.expireDate
let dateToSet = ''
if (typeof expireDate !== 'undefined') {
expireDate = sharingHelper.calculateDate(expireDate)
dateToSet = sharingHelper.calculateDate(expireDate)
}
let targetShareType = null
if (settings.shareTypeString) {
targetShareType = sharingHelper.humanReadableShareTypeToNumber(settings.shareTypeString)
}
const targetShareType = sharingHelper.humanReadableShareTypeToNumber(settings.shareTypeString)
return shareFileFolder(
settings.path,
sharer,
Expand All @@ -153,7 +157,7 @@ Given('user {string} has created a new share with following settings',
settings.permissionString,
settings.name,
{
expireDate: expireDate,
expireDate: dateToSet,
password: settings.password
}
)
Expand Down

0 comments on commit 824b1ed

Please sign in to comment.