refactor: e2e client (#7324)

This commit is contained in:
Jason Rasmussen 2024-02-21 17:34:11 -05:00 committed by GitHub
parent 5c0c98473d
commit 2ebb57cbd4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 19 additions and 146 deletions

View file

@ -531,8 +531,8 @@ describe(`${AssetController.name} (e2e)`, () => {
expect(status).toBe(200);
expect(body.length).toBe(assets.length);
for (let i = 0; i < assets.length; i++) {
expect(body[i]).toEqual(expect.objectContaining({ id: assets[i].id }));
for (const [i, asset] of assets.entries()) {
expect(body[i]).toEqual(expect.objectContaining({ id: asset.id }));
}
});
}
@ -699,7 +699,7 @@ describe(`${AssetController.name} (e2e)`, () => {
it("should not upload to another user's library", async () => {
const content = randomBytes(32);
const library = (await api.libraryApi.getAll(server, user2.accessToken))[0];
const [library] = await api.libraryApi.getAll(server, user2.accessToken);
await api.assetApi.upload(server, user1.accessToken, 'example-image', { content });
const { body, status } = await request(server)