mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
29 lines
936 B
TypeScript
29 lines
936 B
TypeScript
|
|
import { ServerController } from 'src/controllers/server.controller';
|
||
|
|
import { ServerService } from 'src/services/server.service';
|
||
|
|
import { VersionService } from 'src/services/version.service';
|
||
|
|
import request from 'supertest';
|
||
|
|
import { ControllerContext, controllerSetup, mockBaseService } from 'test/utils';
|
||
|
|
|
||
|
|
describe(ServerController.name, () => {
|
||
|
|
let ctx: ControllerContext;
|
||
|
|
|
||
|
|
beforeAll(async () => {
|
||
|
|
ctx = await controllerSetup(ServerController, [
|
||
|
|
{ provide: ServerService, useValue: mockBaseService(ServerService) },
|
||
|
|
{ provide: VersionService, useValue: mockBaseService(VersionService) },
|
||
|
|
]);
|
||
|
|
return () => ctx.close();
|
||
|
|
});
|
||
|
|
|
||
|
|
beforeEach(() => {
|
||
|
|
ctx.reset();
|
||
|
|
});
|
||
|
|
|
||
|
|
describe('GET /server/license', () => {
|
||
|
|
it('should be an authenticated route', async () => {
|
||
|
|
await request(ctx.getHttpServer()).get('/server/license');
|
||
|
|
expect(ctx.authenticate).toHaveBeenCalled();
|
||
|
|
});
|
||
|
|
});
|
||
|
|
});
|