fix issues
This commit is contained in:
@@ -69,7 +69,7 @@ describe('AuthService - New Methods', () => {
|
||||
{ execute: vi.fn() } as any,
|
||||
{ execute: vi.fn() } as any,
|
||||
{ execute: vi.fn() } as any,
|
||||
{ execute: vi.fn() } as any,
|
||||
forgotPasswordUseCase as any,
|
||||
{ execute: vi.fn() } as any,
|
||||
{ execute: vi.fn() } as any,
|
||||
new FakeAuthSessionPresenter() as any,
|
||||
@@ -175,8 +175,9 @@ describe('AuthService - New Methods', () => {
|
||||
const demoLoginPresenter = new FakeDemoLoginPresenter();
|
||||
const mockUser = {
|
||||
getId: () => ({ value: 'demo-user-123' }),
|
||||
getDisplayName: () => 'Demo Driver',
|
||||
getDisplayName: () => 'Alex Johnson',
|
||||
getEmail: () => 'demo.driver@example.com',
|
||||
getPrimaryDriverId: () => undefined,
|
||||
};
|
||||
|
||||
const demoLoginUseCase = {
|
||||
@@ -210,17 +211,20 @@ describe('AuthService - New Methods', () => {
|
||||
const result = await service.demoLogin({ role: 'driver' });
|
||||
|
||||
expect(demoLoginUseCase.execute).toHaveBeenCalledWith({ role: 'driver' });
|
||||
expect(identitySessionPort.createSession).toHaveBeenCalledWith({
|
||||
id: 'demo-user-123',
|
||||
displayName: 'Demo Driver',
|
||||
email: 'demo.driver@example.com',
|
||||
});
|
||||
expect(identitySessionPort.createSession).toHaveBeenCalledWith(
|
||||
{
|
||||
id: 'demo-user-123',
|
||||
displayName: 'Alex Johnson',
|
||||
email: 'demo.driver@example.com',
|
||||
},
|
||||
undefined
|
||||
);
|
||||
expect(result).toEqual({
|
||||
token: 'demo-token-123',
|
||||
user: {
|
||||
userId: 'demo-user-123',
|
||||
email: 'demo.driver@example.com',
|
||||
displayName: 'Demo Driver',
|
||||
displayName: 'Alex Johnson',
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user