Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): Add resend otp implementation #445

Merged
merged 10 commits into from
Oct 13, 2024
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ FEEDBACK_FORWARD_EMAIL=
BACKEND_URL=http://localhost:4200
NEXT_PUBLIC_BACKEND_URL=http://localhost:4200

NODE_ENV=
Prakhargarg-2010196 marked this conversation as resolved.
Show resolved Hide resolved
21 changes: 20 additions & 1 deletion apps/api/src/auth/controller/auth.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { GoogleOAuthStrategyFactory } from '@/config/factory/google/google-strat
import { GitlabOAuthStrategyFactory } from '@/config/factory/gitlab/gitlab-strategy.factory'
import { CacheService } from '@/cache/cache.service'
import { REDIS_CLIENT } from '@/provider/redis.provider'
import { ThrottlerGuard, ThrottlerStorage } from '@nestjs/throttler'
import { Reflector } from '@nestjs/core'

describe('AuthController', () => {
let controller: AuthController
Expand Down Expand Up @@ -40,7 +42,21 @@ describe('AuthController', () => {
keys: jest.fn()
}
}
}
},
//Mocked values for throttler
{
provide: ThrottlerGuard,
useValue: { canActivate: jest.fn(() => true) } // Mocking ThrottlerGuard
},
{
provide: 'THROTTLER:MODULE_OPTIONS', // Mocking THROTTLER:MODULE_OPTIONS
useValue: {} // Empty or default value to satisfy dependency
},
{
provide: ThrottlerStorage, // Mocking Symbol(ThrottlerStorage)
useValue: {} // Empty or default value to satisfy dependency
},
Reflector
]
})
.overrideProvider(PrismaService)
Expand All @@ -53,4 +69,7 @@ describe('AuthController', () => {
it('should be defined', () => {
expect(controller).toBeDefined()
})
it('should be defined', () => {
expect(controller).toBeDefined()
})
})