import { describe, expect, it } from "vitest";

import { DEFAULT_CHARACTER_ID } from "@/data/constants/character";
import { UnlockPrivateRequestSchema } from "@/data/schemas/chat";

describe("UnlockPrivateRequest", () => {
  it("serializes an existing backend message unlock", () => {
    expect(
      UnlockPrivateRequestSchema.parse({
        characterId: DEFAULT_CHARACTER_ID,
        messageId: "message-1",
      }),
    ).toEqual({
      characterId: DEFAULT_CHARACTER_ID,
      messageId: "message-1",
    });
  });

  it("serializes a temporary promotion lock without a fake message id", () => {
    expect(
      UnlockPrivateRequestSchema.parse({
        characterId: DEFAULT_CHARACTER_ID,
        lockType: "voice_message",
        clientLockId: "promotion-1",
      }),
    ).toEqual({
      characterId: DEFAULT_CHARACTER_ID,
      lockType: "voice_message",
      clientLockId: "promotion-1",
    });
  });
});
