test: shared factories and command builders
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user