From 0312e72bd2c2050f337669e58184215edb62e7c1 Mon Sep 17 00:00:00 2001 From: Prarup Gurung Date: Fri, 19 Jan 2024 10:15:20 +0545 Subject: [PATCH] Addressed reviews --- .../apiSharingNg/shareInvitations.feature | 28 ++----------------- .../features/bootstrap/SharingNgContext.php | 2 +- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/tests/acceptance/features/apiSharingNg/shareInvitations.feature b/tests/acceptance/features/apiSharingNg/shareInvitations.feature index c5a7ae180..130f21c17 100644 --- a/tests/acceptance/features/apiSharingNg/shareInvitations.feature +++ b/tests/acceptance/features/apiSharingNg/shareInvitations.feature @@ -23,6 +23,8 @@ Feature: Send a sharing invitations | shareType | user | | permissionsRole | | Then the HTTP status code should be "200" + And for user "Brian" the space Shares should contain these entries: + | | And the JSON data of the response should match """ { @@ -1111,29 +1113,3 @@ Feature: Send a sharing invitations | Co Owner | folder | FolderToShare | | Uploader | folder | FolderToShare | | Manager | folder | FolderToShare | - - - Scenario Outline: send share invitation to normal user - And user "Alice" has created folder "FolderToShare" - And user "Alice" has uploaded file "filesForUpload/textfile.txt" to "textfile.txt" - When user "Alice" sends the following share invitation using the Graph API: - | resourceType | | - | resource | | - | space | Personal | - | sharee | Brian | - | shareType | user | - | permissionsRole | | - Then the HTTP status code should be "200" - And for user "Brian" the space Shares should contain these entries: - | | - Examples: - | permissions-role | resource-type | path | - | Viewer | file | textfile.txt | - | File Editor | file | textfile.txt | - | Co Owner | file | textfile.txt | - | Manager | file | textfile.txt | - | Viewer | folder | FolderToShare | - | Editor | folder | FolderToShare | - | Co Owner | folder | FolderToShare | - | Uploader | folder | FolderToShare | - | Manager | folder | FolderToShare | diff --git a/tests/acceptance/features/bootstrap/SharingNgContext.php b/tests/acceptance/features/bootstrap/SharingNgContext.php index 8ae528bf9..7f18bd793 100644 --- a/tests/acceptance/features/bootstrap/SharingNgContext.php +++ b/tests/acceptance/features/bootstrap/SharingNgContext.php @@ -447,7 +447,7 @@ class SharingNgContext implements Context { ); $contents = \json_decode($response->getBody()->getContents(), true); - $fileFound = !empty(array_intersect(array_column($rows, 0), array_column($contents['value'], 'name'))); + $fileFound = empty(array_diff(array_map(fn ($row) => trim($row[0], '/'), $rows), array_column($contents['value'], 'name'))); $assertMessage = $should ? "Response does not contain the entry."