test: get_users use case

Fake list_with_stats now returns stored users (was always empty).
This commit is contained in:
2026-10-25 22:41:54 +01:00
parent ec22ac1d75
commit fdf4df38af
3 changed files with 53 additions and 1 deletions

View File

@@ -59,7 +59,21 @@ impl UserRepository for InMemoryStore {
}
async fn list_with_stats(&self) -> Result<Vec<UserSummary>, DomainError> {
Ok(vec![])
let store = self.users.read().unwrap();
Ok(store
.values()
.map(|u| {
UserSummary::new(
u.id().clone(),
u.email().clone(),
u.username().clone(),
u.display_name().map(str::to_string),
0,
None,
u.avatar_path().map(str::to_string),
)
})
.collect())
}
async fn update_profile(