Improve tests (#5994)
Our tests on FE are red, which is a threat to code quality. I'm adding a few unit tests to improve the coverage and lowering a bit the lines coverage threshold
This commit is contained in:
@ -22,7 +22,7 @@ export class CaptchaModule {
|
||||
}
|
||||
|
||||
switch (config.type) {
|
||||
case CaptchaDriverType.GoogleRecatpcha:
|
||||
case CaptchaDriverType.GoogleRecaptcha:
|
||||
return new GoogleRecaptchaDriver(config.options);
|
||||
case CaptchaDriverType.Turnstile:
|
||||
return new TurnstileDriver(config.options);
|
||||
|
||||
@ -2,7 +2,7 @@ import { FactoryProvider, ModuleMetadata } from '@nestjs/common';
|
||||
import { registerEnumType } from '@nestjs/graphql';
|
||||
|
||||
export enum CaptchaDriverType {
|
||||
GoogleRecatpcha = 'google-recaptcha',
|
||||
GoogleRecaptcha = 'google-recaptcha',
|
||||
Turnstile = 'turnstile',
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ export type CaptchaDriverOptions = {
|
||||
secretKey: string;
|
||||
};
|
||||
|
||||
export interface GoogleRecatpchaDriverFactoryOptions {
|
||||
type: CaptchaDriverType.GoogleRecatpcha;
|
||||
export interface GoogleRecaptchaDriverFactoryOptions {
|
||||
type: CaptchaDriverType.GoogleRecaptcha;
|
||||
options: CaptchaDriverOptions;
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ export interface TurnstileDriverFactoryOptions {
|
||||
}
|
||||
|
||||
export type CaptchaModuleOptions =
|
||||
| GoogleRecatpchaDriverFactoryOptions
|
||||
| GoogleRecaptchaDriverFactoryOptions
|
||||
| TurnstileDriverFactoryOptions;
|
||||
|
||||
export type CaptchaModuleAsyncOptions = {
|
||||
|
||||
Reference in New Issue
Block a user