check trash deletion by secondary user of shared anonymous file (#433)

This commit is contained in:
Eric Doughty-Papassideris
2024-05-29 11:32:26 +02:00
committed by ericlinagora
parent 6fc5d0945d
commit cebd02a964
@@ -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);