ai fixes
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-06-26 14:44:54 +01:00
parent 25d62ce723
commit 2c4c9b0595
21 changed files with 1553 additions and 259 deletions

View File

@@ -13,14 +13,19 @@ describe("teacherCreateSchema", () => {
expect(result.success).toBe(true);
});
it("accepts null explorationId", () => {
it("accepts optional difficulty and length", () => {
const result = teacherCreateSchema.safeParse({
topic: "Rust ownership",
explorationId: null,
topic: "DNS",
difficulty: "intermediate",
length: "deep",
includeLibraryContext: false,
});
expect(result.success).toBe(true);
if (result.success) {
expect(normalizeTeacherCreateBody(result.data).explorationId).toBeUndefined();
const body = normalizeTeacherCreateBody(result.data);
expect(body.difficulty).toBe("intermediate");
expect(body.length).toBe("deep");
expect(body.includeLibraryContext).toBe(false);
}
});
});