website refactor
This commit is contained in:
@@ -61,7 +61,7 @@ describe('TeamController', () => {
|
||||
const result = { team: { id: teamId, name: 'Team', tag: 'TAG', description: 'Desc', ownerId: 'owner', leagues: [], isRecruiting: false }, membership: null, canManage: false };
|
||||
service.getDetails.mockResolvedValue(result);
|
||||
|
||||
const mockReq = { user: { userId } } as any;
|
||||
const mockReq = { user: { userId } } as never;
|
||||
|
||||
const response = await controller.getDetails(teamId, mockReq);
|
||||
|
||||
@@ -103,7 +103,7 @@ describe('TeamController', () => {
|
||||
const result = { id: 'team-456', success: true };
|
||||
service.create.mockResolvedValue(result);
|
||||
|
||||
const mockReq = { user: { userId } } as any;
|
||||
const mockReq = { user: { userId } } as never;
|
||||
|
||||
const response = await controller.create(input, mockReq);
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('TeamController', () => {
|
||||
const result = { success: true };
|
||||
service.update.mockResolvedValue(result);
|
||||
|
||||
const mockReq = { user: { userId } } as any;
|
||||
const mockReq = { user: { userId } } as never;
|
||||
|
||||
const response = await controller.update(teamId, input, mockReq);
|
||||
|
||||
@@ -157,7 +157,7 @@ describe('TeamController', () => {
|
||||
});
|
||||
|
||||
describe('auth guards (HTTP)', () => {
|
||||
let app: any;
|
||||
let app: import("@nestjs/common").INestApplication;
|
||||
|
||||
const sessionPort: { getCurrentSession: () => Promise<null | { token: string; user: { id: string } }> } = {
|
||||
getCurrentSession: vi.fn(async () => null),
|
||||
@@ -196,9 +196,9 @@ describe('TeamController', () => {
|
||||
|
||||
const reflector = new Reflector();
|
||||
app.useGlobalGuards(
|
||||
new AuthenticationGuard(sessionPort as any),
|
||||
new AuthorizationGuard(reflector, authorizationService as any),
|
||||
new FeatureAvailabilityGuard(reflector, policyService as any),
|
||||
new AuthenticationGuard(sessionPort as never),
|
||||
new AuthorizationGuard(reflector, authorizationService as never),
|
||||
new FeatureAvailabilityGuard(reflector, policyService as never),
|
||||
);
|
||||
|
||||
await app.init();
|
||||
|
||||
Reference in New Issue
Block a user