fix core tests

This commit is contained in:
2025-12-23 20:09:02 +01:00
parent 7290fe69b5
commit b5431355ca
25 changed files with 415 additions and 211 deletions

View File

@@ -61,11 +61,16 @@ describe('LoginWithEmailUseCase', () => {
id: 'user-1',
email: 'test@example.com',
displayName: 'Test User',
passwordHash: 'hashed-password',
passwordHash: '',
salt: 'salt',
createdAt: new Date(),
};
storedUser.passwordHash = await (useCase as unknown as { hashPassword: (p: string, s: string) => Promise<string> }).hashPassword(
input.password,
storedUser.salt,
);
const session = {
user: {
id: storedUser.id,
@@ -89,9 +94,8 @@ describe('LoginWithEmailUseCase', () => {
expect(userRepository.findByEmail).toHaveBeenCalledWith('test@example.com');
expect(sessionPort.createSession).toHaveBeenCalledWith({
id: storedUser.id,
email: storedUser.email,
displayName: storedUser.displayName,
primaryDriverId: undefined,
email: storedUser.email,
});
expect(output.present).toHaveBeenCalledTimes(1);