import { RichText } from "../types";
import { toPlainText } from "../utils";

const testRichText = [
  {
    type: "text",
    plain_text: "NTMS",
    annotations: {
      bold: false,
      italic: false,
      strikethrough: false,
      underline: false,
      code: false,
      color: "default",
    },
    href: null,
  },
  {
    type: "text",
    plain_text: " IS AWESOME",
    annotations: {
      bold: false,
      italic: false,
      strikethrough: false,
      underline: true,
      code: false,
      color: "default",
    },
    href: null,
  },
] as RichText[];

describe("To plain text", () => {
  it("Should return a plain text", () => {
    expect(toPlainText(testRichText)).toEqual("NTMS IS AWESOME");
  });
});
