1
0
forked from Cutlery/immich
immich-quadlet/e2e/src/api/specs/oauth.e2e-spec.ts
Jason Rasmussen b733a29430
refactor: e2e (#7703)
* refactor: e2e

* fix: submodule check

* chore: extend startup timeout
2024-03-07 10:14:36 -05:00

20 lines
674 B
TypeScript

import { errorDto } from 'src/responses';
import { app, utils } from 'src/utils';
import request from 'supertest';
import { beforeAll, describe, expect, it } from 'vitest';
describe(`/oauth`, () => {
beforeAll(async () => {
await utils.resetDatabase();
await utils.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']));
});
});
});