This commit is contained in:
2025-12-04 17:07:59 +01:00
parent 60a3c82cd9
commit 88c6befc7c
33 changed files with 602 additions and 261 deletions

View File

@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest';
import { Result } from '@/packages/shared/result/Result';
import { Result } from '@gridpilot/shared-result';
import { CheckoutConfirmation } from '@gridpilot/automation/domain/value-objects/CheckoutConfirmation';
import { CheckoutPrice } from '@gridpilot/automation/domain/value-objects/CheckoutPrice';
import { CheckoutState } from '@gridpilot/automation/domain/value-objects/CheckoutState';

View File

@@ -1,11 +1,11 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { ConfirmCheckoutUseCase } from '@/packages/automation/application/use-cases/ConfirmCheckoutUseCase';
import { Result } from '@/packages/shared/result/Result';
import { ConfirmCheckoutUseCase } from '@gridpilot/automation/application/use-cases/ConfirmCheckoutUseCase';
import { Result } from '@gridpilot/shared-result';
import { CheckoutPrice } from '@gridpilot/automation/domain/value-objects/CheckoutPrice';
import { CheckoutState } from '@gridpilot/automation/domain/value-objects/CheckoutState';
import { CheckoutConfirmation } from '@gridpilot/automation/domain/value-objects/CheckoutConfirmation';
import type { ICheckoutService } from '@/packages/automation/application/ports/ICheckoutService';
import type { ICheckoutConfirmationPort } from '@/packages/automation/application/ports/ICheckoutConfirmationPort';
import type { ICheckoutService } from '@gridpilot/automation/application/ports/ICheckoutService';
import type { ICheckoutConfirmationPort } from '@gridpilot/automation/application/ports/ICheckoutConfirmationPort';
describe('ConfirmCheckoutUseCase - Enhanced with Confirmation Port', () => {
let mockCheckoutService: ICheckoutService;

View File

@@ -1,6 +1,6 @@
import { describe, test, expect, beforeEach, vi } from 'vitest';
import type { Page } from 'playwright';
import { AuthenticationGuard } from 'packages/automation/infrastructure/adapters/automation/auth/AuthenticationGuard';
import { AuthenticationGuard } from '@gridpilot/automation/infrastructure/adapters/automation/auth/AuthenticationGuard';
describe('AuthenticationGuard', () => {
let mockPage: Page;

View File

@@ -1,5 +1,5 @@
import { describe, test, expect, beforeEach } from 'vitest';
import { SessionCookieStore } from 'packages/automation/infrastructure/adapters/automation/auth/SessionCookieStore';
import { SessionCookieStore } from '@gridpilot/automation/infrastructure/adapters/automation/auth/SessionCookieStore';
import type { Cookie } from 'playwright';
describe('SessionCookieStore - Cookie Validation', () => {

View File

@@ -51,13 +51,13 @@ describe('InMemoryAuthService', () => {
expect(session.user.primaryDriverId).not.toBe('');
});
it('logout does not attempt to modify cookies directly', async () => {
it('logout clears the demo session cookie via adapter', async () => {
const service = new InMemoryAuthService();
await service.logout();
expect(cookieStore.get).not.toHaveBeenCalled();
expect(cookieStore.set).not.toHaveBeenCalled();
expect(cookieStore.delete).not.toHaveBeenCalled();
expect(cookieStore.delete).toHaveBeenCalledWith('gp_demo_session');
});
});