test.govlab/patterns/core/formatters/markup.formatter.test.ts
test.govlab/patterns/core/formatters/markup.formatter.test.ts is a file in Codebase Testing. 13 lines of code and 0 definitions.
import { anchorMarkup, escapeXml } from "@govlab/patterns/core/formatters/markup.formatter.ts";
import { describe, expect, it } from "vitest";
describe("escapeXml", () => {
it("escapes the five XML-significant characters and leaves the rest", () => {
expect(escapeXml(`<a href="x">'&'</a>`)).toBe("<a href="x">'&'</a>");
expect(escapeXml("plain")).toBe("plain");
});
});
describe("anchorMarkup", () => {
it("wraps a label in an anchor to its href", () => {
expect(anchorMarkup("report.html", "Report")).toBe('<a href="report.html">Report</a>');
});
});