From 804ef17ffe9f562dd85ac0de707af5d03de47c41 Mon Sep 17 00:00:00 2001 From: Kiran Parajuli Date: Fri, 6 Mar 2020 16:48:51 +0545 Subject: [PATCH] refactors --- .../pageObjects/FilesPageElement/sharingDialog.js | 10 +++++----- tests/acceptance/stepDefinitions/sharingContext.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js b/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js index a5ba6ae5282..95c12a12cb2 100644 --- a/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js +++ b/tests/acceptance/pageObjects/FilesPageElement/sharingDialog.js @@ -190,7 +190,7 @@ module.exports = { .waitForOutstandingAjaxCalls() .waitForElementNotPresent('@addShareSaveButton') }, - saveCollaboratorEditForm: function () { + saveChanges: function () { return this.waitForElementVisible('@saveShareButton') .initAjaxCounters() .click('@saveShareButton') @@ -268,7 +268,7 @@ module.exports = { } } if (changed) { - await this.saveCollaboratorEditForm() + await this.saveChanges() } else { await this.clickCancel() } @@ -298,7 +298,7 @@ module.exports = { for (const permission of enabledPermissions) { await this.toggleSinglePermission(permission) } - await this.saveCollaboratorEditForm() + await this.saveChanges() }, /** * @@ -370,7 +370,7 @@ module.exports = { changeCollaboratorRole: async function (collaborator, newRole) { await collaboratorDialog.clickEditShare(collaborator) await this.changeCollaboratorRoleInDropdown(newRole) - return this.saveCollaboratorEditForm() + return this.saveChanges() }, /** * @params {string} newRole @@ -498,7 +498,7 @@ module.exports = { .FilesPageElement .publicLinksDialog() .setPublicLinkExpiryDate(value) - return this.saveCollaboratorEditForm() + return this.saveChanges() } }, elements: { diff --git a/tests/acceptance/stepDefinitions/sharingContext.js b/tests/acceptance/stepDefinitions/sharingContext.js index 170a09423a5..bb1bcc17145 100644 --- a/tests/acceptance/stepDefinitions/sharingContext.js +++ b/tests/acceptance/stepDefinitions/sharingContext.js @@ -141,8 +141,8 @@ Given('user {string} has created a new share with following settings', function (sharer, dataTable) { const settings = dataTable.rowsHash() let expireDate = settings.expireDate - if (typeof settings.expireDate !== 'undefined') { - expireDate = sharingHelper.calculateDate(settings.expireDate) + if (typeof expireDate !== 'undefined') { + expireDate = sharingHelper.calculateDate(expireDate) } return shareFileFolder( settings.path,