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

import { UnlockPrivateRequest } from "@/data/dto/chat";

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

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