mirror of
https://github.com/immich-app/immich.git
synced 2025-07-07 09:12:56 +02:00
refactor(server): e2e (#7223)
* refactor: download e2e * refactor: oauth e2e * refactor: system config e2e * refactor: partner e2e * refactor: server-info e2e * refactor: user e2e * chore: uncomment test
This commit is contained in:
parent
02b9f3ee88
commit
9b20604a70
12 changed files with 632 additions and 528 deletions
e2e/src/api/specs
30
e2e/src/api/specs/oauth.e2e-spec.ts
Normal file
30
e2e/src/api/specs/oauth.e2e-spec.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
import { errorDto } from 'src/responses';
|
||||
import { apiUtils, app, dbUtils } from 'src/utils';
|
||||
import request from 'supertest';
|
||||
import { beforeAll, beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
describe(`/oauth`, () => {
|
||||
beforeAll(() => {
|
||||
apiUtils.setup();
|
||||
});
|
||||
|
||||
beforeEach(async () => {
|
||||
await dbUtils.reset();
|
||||
await apiUtils.adminSetup();
|
||||
});
|
||||
|
||||
describe('POST /oauth/authorize', () => {
|
||||
it(`should throw an error if a redirect uri is not provided`, async () => {
|
||||
const { status, body } = await request(app)
|
||||
.post('/oauth/authorize')
|
||||
.send({});
|
||||
expect(status).toBe(400);
|
||||
expect(body).toEqual(
|
||||
errorDto.badRequest([
|
||||
'redirectUri must be a string',
|
||||
'redirectUri should not be empty',
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue