Refactor infra tests, clean E2E step suites, and fix TS in tests

This commit is contained in:
2025-11-30 10:58:49 +01:00
parent af14526ae2
commit f8a1fbeb50
43 changed files with 883 additions and 2159 deletions

View File

@@ -3,16 +3,7 @@ import { CheckAuthenticationUseCase } from '../../../../packages/application/use
import { AuthenticationState } from '../../../../packages/domain/value-objects/AuthenticationState';
import { BrowserAuthenticationState } from '../../../../packages/domain/value-objects/BrowserAuthenticationState';
import { Result } from '../../../../packages/shared/result/Result';
interface IAuthenticationService {
checkSession(): Promise<Result<AuthenticationState>>;
initiateLogin(): Promise<Result<void>>;
clearSession(): Promise<Result<void>>;
getState(): AuthenticationState;
validateServerSide(): Promise<Result<boolean>>;
refreshSession(): Promise<Result<void>>;
getSessionExpiry(): Promise<Result<Date | null>>;
}
import type { IAuthenticationService } from '../../../../packages/application/ports/IAuthenticationService';
interface ISessionValidator {
validateSession(): Promise<Result<boolean>>;
@@ -27,6 +18,7 @@ describe('CheckAuthenticationUseCase', () => {
validateServerSide: Mock;
refreshSession: Mock;
getSessionExpiry: Mock;
verifyPageAuthentication: Mock;
};
let mockSessionValidator: {
validateSession: Mock;
@@ -41,6 +33,7 @@ describe('CheckAuthenticationUseCase', () => {
validateServerSide: vi.fn(),
refreshSession: vi.fn(),
getSessionExpiry: vi.fn(),
verifyPageAuthentication: vi.fn(),
};
mockSessionValidator = {