Add trash of anonymous file e2e tests (#433)

This commit is contained in:
Eric Doughty-Papassideris
2024-05-27 20:58:29 +02:00
committed by ericlinagora
parent 14864ab60c
commit b9fb180589
2 changed files with 55 additions and 18 deletions
@@ -245,6 +245,13 @@ export default class UserApi {
return result;
}
/** Gets the public link access token then `impersonateWithJWT` as an anonymous user with that link */
async impersonatePublicLinkAccessOf<T>(item: Partial<DriveFile> & { id: string }, cb: () => Promise<T>): Promise<T> {
const publicToken = await this.getPublicLinkAccessToken(item);
expect(publicToken?.value?.length ?? "").toBeGreaterThan(0);
return this.impersonateWithJWT(publicToken?.value, cb);
}
async createDocument(
item: Partial<DriveFile>,
version: Partial<FileVersion>