fix issues in core

This commit is contained in:
2025-12-23 17:31:45 +01:00
parent d04a21fe02
commit 4318b380d9
34 changed files with 116 additions and 103 deletions

View File

@@ -2,9 +2,8 @@ import { describe, it, expect, vi, type Mock } from 'vitest';
import { HandleAuthCallbackUseCase } from './HandleAuthCallbackUseCase';
import type { IdentityProviderPort } from '../ports/IdentityProviderPort';
import type { IdentitySessionPort } from '../ports/IdentitySessionPort';
import type { AuthCallbackCommandDTO } from '../dto/AuthCallbackCommandDTO';
import type { AuthenticatedUserDTO } from '../dto/AuthenticatedUserDTO';
import type { AuthSessionDTO } from '../dto/AuthSessionDTO';
import type { AuthCallbackCommand, AuthenticatedUser } from '../ports/IdentityProviderPort';
import type { AuthSession } from '../ports/IdentitySessionPort';
import type { Logger, UseCaseOutputPort } from '@core/shared/application';
describe('HandleAuthCallbackUseCase', () => {
@@ -17,7 +16,7 @@ describe('HandleAuthCallbackUseCase', () => {
clearSession: Mock;
};
let logger: Logger;
let output: UseCaseOutputPort<AuthSessionDTO> & { present: Mock };
let output: UseCaseOutputPort<AuthSession> & { present: Mock };
let useCase: HandleAuthCallbackUseCase;
beforeEach(() => {
@@ -48,20 +47,20 @@ describe('HandleAuthCallbackUseCase', () => {
});
it('completes auth and creates a session', async () => {
const command: AuthCallbackCommandDTO = {
const command: AuthCallbackCommand = {
provider: 'IRACING_DEMO',
code: 'auth-code',
state: 'state-123',
returnTo: 'https://app/callback',
};
const user: AuthenticatedUserDTO = {
const user: AuthenticatedUser = {
id: 'user-1',
email: 'test@example.com',
displayName: 'Test User',
};
const session: AuthSessionDTO = {
const session: AuthSession = {
user,
issuedAt: Date.now(),
expiresAt: Date.now() + 1000,