Skip to content

Commit

Permalink
✅ check trash deletion by secondary user of shared anonymous file (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
ericlinagora committed May 29, 2024
1 parent 6fc5d09 commit cebd02a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tdrive/backend/node/test/e2e/documents/trash.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,16 @@ describe("the Drive's documents' trash feature", () => {
scope: "personal",
}));

const secondaryUser = await UserApi.getInstance(platform!);
const secondaryUser = await UserApi.getInstance(platform!, true);

const deletionToTrashResponse = await secondaryUser.delete(anonymouslyUploadedDoc.id);
let deletionToTrashResponse = await secondaryUser.delete(anonymouslyUploadedDoc.id);
expect(deletionToTrashResponse.statusCode).toBe(500);

// The following depends on inheriting permissions being the default behaviour (subject to change in the future)
const changeRightsResponse = await currentUser.shareWithPermissions(publiclyWriteableFolder, secondaryUser.user.id, "manage");
expect(changeRightsResponse.statusCode).toBe(200);

deletionToTrashResponse = await secondaryUser.delete(anonymouslyUploadedDoc.id);
expect(deletionToTrashResponse.statusCode).toBe(200);

expect((await getTrashContentIds("personal"))).toContain(anonymouslyUploadedDoc.id);
Expand Down

0 comments on commit cebd02a

Please sign in to comment.