From 469341c027e4bf721103154e90b84cfa7c56b4e6 Mon Sep 17 00:00:00 2001 From: Nalem7 <61624650+nabim777@users.noreply.github.com> Date: Wed, 12 Jul 2023 10:34:21 +0545 Subject: [PATCH] add test for search by deleted tag (#6660) --- .../features/apiGraph/fullSearch.feature | 17 +++++++++++++++++ .../features/bootstrap/TagContext.php | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/tests/acceptance/features/apiGraph/fullSearch.feature b/tests/acceptance/features/apiGraph/fullSearch.feature index de9b234b80d..3eb56296864 100644 --- a/tests/acceptance/features/apiGraph/fullSearch.feature +++ b/tests/acceptance/features/apiGraph/fullSearch.feature @@ -72,3 +72,20 @@ Feature: full text search | dav-path-version | | old | | new | + + + Scenario Outline: search files using a deleted tag + Given using DAV path + And user "Alice" has uploaded file with content "hello world" to "file1.txt" + And user "Alice" has created the following tags for file "file1.txt" of the space "Personal": + | tag1 | + And user "Alice" has removed the following tags for file "file1.txt" of space "Personal": + | tag1 | + When user "Alice" searches for "Tags:tag1" using the WebDAV API + Then the HTTP status code should be "207" + And the search result should contain "0" entries + Examples: + | dav-path-version | + | old | + | new | + | spaces | diff --git a/tests/acceptance/features/bootstrap/TagContext.php b/tests/acceptance/features/bootstrap/TagContext.php index edecd4426a7..d5f47331e75 100644 --- a/tests/acceptance/features/bootstrap/TagContext.php +++ b/tests/acceptance/features/bootstrap/TagContext.php @@ -179,4 +179,21 @@ public function userRemovesTagsFromResourceOfTheSpace(string $user, string $file ); $this->featureContext->setResponse($response); } + + /** + * @Given /^user "([^"]*)" has removed the following tags for (folder|file) "([^"]*)" of space "([^"]*)":$/ + * + * @param string $user + * @param string $fileOrFolder (file|folder) + * @param string $resource + * @param string $space + * @param TableNode $table + * + * @return void + * @throws Exception + */ + public function userHAsRemovedTheFollowingTagsForFileOfSpace(string $user, string $fileOrFolder, string $resource, string $space, TableNode $table):void { + $this->userRemovesTagsFromResourceOfTheSpace($user, $fileOrFolder, $resource, $space, $table); + $this->featureContext->theHttpStatusCodeShouldBe(200); + } }