@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user