import { expect } from "@std/expect";
import { describe, test } from "@std/testing/bdd";
import { convertMdxToMarkdown } from "./convert";
import { getHomePage } from "./utils";
describe("convertMdxToMarkdown", () => {
test("serializes Details regardless of the props that follow summary", () => {
const markdown = convertMdxToMarkdown({
metadata: { title: "t" },
content:
'\n\nAnswer.\n\n ',
slug: "t",
href: "/t",
} as Parameters[0]);
expect(markdown).toContain("Q?");
expect(markdown).toContain("Answer.");
});
test("the home page keeps every FAQ entry in its markdown representation", () => {
const home = getHomePage();
const markdown = convertMdxToMarkdown(home);
for (const entry of home.metadata.faq ?? []) {
expect(markdown).toContain(`${entry.question}`);
}
});
});