test(chat): add test for defaulting nullable content to an empty string

This commit is contained in:
2026-06-30 19:29:41 +08:00
parent ed109f25a0
commit a105820b88
2 changed files with 20 additions and 1 deletions
@@ -1,5 +1,6 @@
import { z } from "zod";
import { stringOrEmpty } from "../nullable-defaults";
import { ChatLockDetailSchema } from "./chat_payloads";
/**
@@ -9,7 +10,7 @@ export const UnlockPrivateReasonSchema = z.string().default("");
export const UnlockPrivateResponseSchema = z.object({
unlocked: z.boolean(),
content: z.string().default(""),
content: stringOrEmpty,
reason: UnlockPrivateReasonSchema,
creditBalance: z.number().default(0),
creditsCharged: z.number().default(0),