Fix e2e trash tests to check for personal trash folders (#433)

This commit is contained in:
Eric Doughty-Papassideris
2024-05-28 15:41:53 +02:00
committed by ericlinagora
parent 7113173456
commit 71e3240c94
2 changed files with 58 additions and 49 deletions
@@ -216,12 +216,13 @@ export default class UserApi {
return files;
};
async createDirectory(parent = "root") {
async createDirectory(parent = "root", overrides?: Partial<DriveFile>) {
const directory = await this.createDocument({
company_id: this.platform.workspace.company_id,
name: "Test Folder Name",
parent_id: parent,
is_directory: true
is_directory: true,
...overrides
}, {});
expect(directory).toBeDefined();
expect(directory).not.toBeNull();
@@ -230,9 +231,7 @@ export default class UserApi {
return directory;
}
/** Run the provided callback using the specified bearer JWT token.
* //TODO: Warning: does not override calls using `this.api` have to discuss
*/
/** Run the provided callback using the specified bearer JWT token */
async impersonateWithJWT<T>(jwt: string, cb: () => Promise<T>): Promise<T> {
const previous = this.jwt;
this.jwt = jwt;