Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Jun 3, 2024
1 parent 2c8431d commit f050463
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/api/src/auth/auth.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { ChangePasswordDto } from './dto/change-password.dto';
import { DeleteAccountDto } from './dto/delete-account.dto';
import { UpdateEmailDto } from './dto/update-email.dto';
import { UserRegisterDto } from './dto/user-register.dto';
import { NotOrgOwnerGuard } from '../models/users/guards/org-owner.guard';
import { MockGuard } from '../mocks/mock.guard';

describe('AuthController', () => {
let controller: AuthController;
Expand Down Expand Up @@ -51,6 +53,8 @@ describe('AuthController', () => {
.useValue(mockAuthService)
.overrideProvider(AuthEmailsService)
.useValue(mockAuthEmailService)
.overrideGuard(NotOrgOwnerGuard)
.useValue(MockGuard)
.compile();

controller = module.get<AuthController>(AuthController);
Expand Down
8 changes: 8 additions & 0 deletions apps/api/src/mocks/mock.guard.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';

@Injectable()
export class MockGuard implements CanActivate {
async canActivate(context: ExecutionContext) {

Check warning on line 5 in apps/api/src/mocks/mock.guard.ts

View workflow job for this annotation

GitHub Actions / Lint

'context' is defined but never used
return true;
}
}

0 comments on commit f050463

Please sign in to comment.