test: shared factories and command builders

This commit is contained in:
2026-10-25 22:08:17 +01:00
parent 2ac1d4e0cf
commit 51d92e08a7
58 changed files with 784 additions and 1344 deletions

View File

@@ -1,7 +1,8 @@
use crate::test_support::create_goal_command;
use uuid::Uuid;
use crate::goals::deps::{GoalCommandDeps, GoalQueryDeps};
use crate::goals::{commands::CreateGoalCommand, create, list, queries::ListGoalsQuery};
use crate::goals::{create, list, queries::ListGoalsQuery};
use crate::test_helpers::TestContextBuilder;
#[tokio::test]
@@ -38,16 +39,9 @@ async fn returns_all_goals_for_user() {
};
for year in [2023, 2024, 2025] {
create::execute(
&cmd_deps,
CreateGoalCommand {
user_id: Uuid::nil(),
year,
target_count: 10,
},
)
.await
.unwrap();
create::execute(&cmd_deps, create_goal_command(year, 10))
.await
.unwrap();
}
let result = list::execute(