From 07c8b011d854dfddd223289a2ca6c3aab9213f49 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Sun, 25 Oct 2026 22:52:41 +0100 Subject: [PATCH] fake user store: list_with_stats sorted by email --- crates/adapters/http-axum/src/tests/mod.rs | 2 -- .../html/forms_tests.rs => tests/log_review_form_test.rs} | 0 .../tests/http_handlers/api_handlers_test.rs} | 0 .../tests/http_handlers/app_context_test.rs} | 0 .../tests/http_handlers/extractors_test.rs} | 0 crates/domain/src/testing/fakes/store_user.rs | 8 ++++++-- 6 files changed, 6 insertions(+), 4 deletions(-) delete mode 100644 crates/adapters/http-axum/src/tests/mod.rs rename crates/adapters/http-axum/{src/html/forms_tests.rs => tests/log_review_form_test.rs} (100%) rename crates/{adapters/http-axum/src/tests/api_handlers.rs => bootstrap/tests/http_handlers/api_handlers_test.rs} (100%) rename crates/{adapters/http-axum/src/tests/context.rs => bootstrap/tests/http_handlers/app_context_test.rs} (100%) rename crates/{adapters/http-axum/src/extractors/tests.rs => bootstrap/tests/http_handlers/extractors_test.rs} (100%) diff --git a/crates/adapters/http-axum/src/tests/mod.rs b/crates/adapters/http-axum/src/tests/mod.rs deleted file mode 100644 index afb3afae..00000000 --- a/crates/adapters/http-axum/src/tests/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -mod api_handlers; -mod context; diff --git a/crates/adapters/http-axum/src/html/forms_tests.rs b/crates/adapters/http-axum/tests/log_review_form_test.rs similarity index 100% rename from crates/adapters/http-axum/src/html/forms_tests.rs rename to crates/adapters/http-axum/tests/log_review_form_test.rs diff --git a/crates/adapters/http-axum/src/tests/api_handlers.rs b/crates/bootstrap/tests/http_handlers/api_handlers_test.rs similarity index 100% rename from crates/adapters/http-axum/src/tests/api_handlers.rs rename to crates/bootstrap/tests/http_handlers/api_handlers_test.rs diff --git a/crates/adapters/http-axum/src/tests/context.rs b/crates/bootstrap/tests/http_handlers/app_context_test.rs similarity index 100% rename from crates/adapters/http-axum/src/tests/context.rs rename to crates/bootstrap/tests/http_handlers/app_context_test.rs diff --git a/crates/adapters/http-axum/src/extractors/tests.rs b/crates/bootstrap/tests/http_handlers/extractors_test.rs similarity index 100% rename from crates/adapters/http-axum/src/extractors/tests.rs rename to crates/bootstrap/tests/http_handlers/extractors_test.rs diff --git a/crates/domain/src/testing/fakes/store_user.rs b/crates/domain/src/testing/fakes/store_user.rs index d19008a9..0d76498f 100644 --- a/crates/domain/src/testing/fakes/store_user.rs +++ b/crates/domain/src/testing/fakes/store_user.rs @@ -58,10 +58,14 @@ impl UserRepository for InMemoryStore { Ok(self.users.read().unwrap().get(&id.value()).cloned()) } + /// Ordered by email ascending like the real query. Diary stats are stubbed + /// (review count 0, no last activity); only the identity fields are real. async fn list_with_stats(&self) -> Result, DomainError> { let store = self.users.read().unwrap(); - Ok(store - .values() + let mut users: Vec<_> = store.values().collect(); + users.sort_by(|a, b| a.email().value().cmp(b.email().value())); + Ok(users + .into_iter() .map(|u| { UserSummary::new( u.id().clone(),