test authorization module

This commit is contained in:
Gsk54 2023-01-16 17:33:22 +01:00
parent 50742fc53a
commit f67a0ef870
1 changed files with 7 additions and 1 deletions

View File

@ -3,6 +3,7 @@ import { AutomapperModule } from '@automapper/nestjs';
import { Test, TestingModule } from '@nestjs/testing';
import { ValidateAuthorizationRequest } from '../../domain/dtos/validate-authorization.request';
import { ValidateAuthorizationUseCase } from '../../domain/usecases/validate-authorization.usecase';
import { ValidateAuthorizationQuery } from '../../queries/validate-authorization.query';
describe('ValidateAuthorizationUseCase', () => {
let validateAuthorizationUseCase: ValidateAuthorizationUseCase;
@ -31,7 +32,12 @@ describe('ValidateAuthorizationUseCase', () => {
validateAuthorizationRequest.action = 'authorized';
expect(
validateAuthorizationUseCase.execute(validateAuthorizationRequest),
validateAuthorizationUseCase.execute(
new ValidateAuthorizationQuery(
validateAuthorizationRequest.uuid,
validateAuthorizationRequest.action,
),
),
).toBeTruthy();
});
});