Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API test for deleteShare #31529

Merged
merged 1 commit into from
May 29, 2018

Conversation

paurakhsharma
Copy link
Member

@paurakhsharma paurakhsharma commented May 25, 2018

Description

This PR adds more API tests for deleting shares.

Related Issue

#31531

How Has This Been Tested?

Locally

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Acceptance test

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Then as "user1" the folder "/sub" should not exist
And user "user0" has shared folder "/common/sub" with user "user1"
When user "user0" deletes folder "/common" using the API
Then the OCS status code should be "100"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something went wrong here in the CI

And the etag of element "/PARENT" of user "user0" should not have changed

Scenario: sharee of a read-only share folder tries to delete the shared folder
Copy link
Contributor

@phil-davis phil-davis May 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/share folder/shared folder/

"tries to delete a file in the shared folder"

| shareType | 0 |
| permissions | 1 |
When user "user1" deletes file "/shared/shared_file.txt" using the API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After this step, can we check OCS/HTTP status? Should be some fail code?
Same in the following scenarios...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Then as "user1" the file "/shared/shared_file.txt" should exist

Scenario: sharee of a upload-only share folder tries to delete the shared folder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/share folder/shared folder/

"tries to delete a file in the shared folder"

Then as "user0" the file "/shared/shared_file.txt" should exist

Scenario: sharee of a upload-only share folder tries to delete his share in the folder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"sharee of a upload-only shared folder tries to delete a file that he uploaded in the folder"

Copy link
Contributor

@phil-davis phil-davis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few little comments...

@paurakhsharma paurakhsharma force-pushed the API-test-deleteShare branch from 66b72d2 to d63a08e Compare May 25, 2018 11:07
@codecov
Copy link

codecov bot commented May 25, 2018

Codecov Report

Merging #31529 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master   #31529   +/-   ##
=========================================
  Coverage     62.61%   62.61%           
  Complexity    18273    18273           
=========================================
  Files          1147     1147           
  Lines         68627    68627           
  Branches       1234     1234           
=========================================
  Hits          42971    42971           
  Misses        25295    25295           
  Partials        361      361
Flag Coverage Δ Complexity Δ
#javascript 52.05% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 63.81% <ø> (ø) 18273 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 55669dd...e6328b5. Read the comment docs.

When user "user0" empties the trashbin using the API
And user "user0" has shared folder "/common/sub" with user "user1"
When user "user0" deletes folder "/common" using the API
Then the HTTP status code should be "204"
Then as "user1" the folder "/sub" should not exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Then/And

And as "user0" the file "/shared/shared_file.txt" should exist

Scenario: sharee of a upload-only share folder tries to delete his share in the folder
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tries to delete his file in the folder

@paurakhsharma paurakhsharma force-pushed the API-test-deleteShare branch from d63a08e to e6328b5 Compare May 29, 2018 08:17
@phil-davis
Copy link
Contributor

All comments have been addressed. Ready for merge when CI is finished.

@paurakhsharma
Copy link
Member Author

Backport on #31574

@phil-davis phil-davis merged commit de95a6b into owncloud:master May 29, 2018
@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants