mirror of
https://github.com/immich-app/immich
synced 2026-08-29 13:15:45 +00:00
refactor(server): migrate e2e auth/validation tests to controller specs
This commit is contained in:
parent
ee525f159b
commit
fc3be6a3c9
36 changed files with 125 additions and 1108 deletions
|
|
@ -3,7 +3,6 @@ import { LoggingRepository } from 'src/repositories/logging.repository';
|
|||
import { PluginService } from 'src/services/plugin.service';
|
||||
import request from 'supertest';
|
||||
import { errorDto } from 'test/medium/responses';
|
||||
import { factory } from 'test/small.factory';
|
||||
import { automock, ControllerContext, controllerSetup, mockBaseService } from 'test/utils';
|
||||
|
||||
describe(PluginController.name, () => {
|
||||
|
|
@ -24,11 +23,6 @@ describe(PluginController.name, () => {
|
|||
});
|
||||
|
||||
describe('GET /plugins', () => {
|
||||
it('should be an authenticated route', async () => {
|
||||
await request(ctx.getHttpServer()).get('/plugins');
|
||||
expect(ctx.authenticate).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it(`should require id to be a uuid`, async () => {
|
||||
const { status, body } = await request(ctx.getHttpServer())
|
||||
.get(`/plugins`)
|
||||
|
|
@ -40,11 +34,6 @@ describe(PluginController.name, () => {
|
|||
});
|
||||
|
||||
describe('GET /plugins/:id', () => {
|
||||
it('should be an authenticated route', async () => {
|
||||
await request(ctx.getHttpServer()).get(`/plugins/${factory.uuid()}`);
|
||||
expect(ctx.authenticate).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it(`should require id to be a uuid`, async () => {
|
||||
const { status, body } = await request(ctx.getHttpServer())
|
||||
.get(`/plugins/invalid`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue