Skip to content

Commit

Permalink
Fix iep benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
francisli committed Jan 24, 2025
1 parent 7128456 commit ab9ba5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/backend/routers/iep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ test("basic flow - add/get goals, benchmarks, tasks", async (t) => {
metric_name: "words",
attempts_per_trial: 10,
number_of_trials: 30,
due_date: new Date("2023-12-31"),
trial_count: 5,
});
const benchmark2Id = benchmark2!.benchmark_id;

await trpc.iep.addTask.mutate({
benchmark_id: benchmark1Id,
assignee_id: para_id,
due_date: new Date("2023-12-31"),
trial_count: 5,
});

const assignTask = await trpc.iep.assignTaskToParas.mutate({
Expand All @@ -95,6 +95,8 @@ test("basic flow - add/get goals, benchmarks, tasks", async (t) => {
benchmark_id: benchmark2Id,
});
t.is(gotBenchmark[0].description, "benchmark 2");
t.deepEqual(gotBenchmark[0].due_date, new Date("2023-12-31"));
t.is(gotBenchmark[0].trial_count, 5);

// TODO: Don't query db directly and use an API method instead. Possibly create a getTasks method later
t.truthy(
Expand Down
4 changes: 2 additions & 2 deletions src/backend/routers/iep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ export const iep = router({
metric_name: z.string(),
attempts_per_trial: z.number().nullable(),
number_of_trials: z.number().nullable(),
due_date: z.date(),
trial_count: z.number(),
due_date: z.date().nullable().optional(),
trial_count: z.number().nullable().optional(),
})
)
.mutation(async (req) => {
Expand Down

0 comments on commit ab9ba5a

Please sign in to comment.