import { qtypeName } from "./qtype";

test("common qtype codes render as DNS type names", () => {
	expect(qtypeName(1)).toBe("A");
	expect(qtypeName(28)).toBe("AAAA");
	expect(qtypeName(5)).toBe("CNAME");
	expect(qtypeName(65)).toBe("HTTPS");
	expect(qtypeName(16)).toBe("TXT");
});

test("unknown codes fall back to TYPE<n>", () => {
	expect(qtypeName(99)).toBe("TYPE99");
	expect(qtypeName(0)).toBe("TYPE0");
});

test("null qtype renders as a dash", () => {
	expect(qtypeName(null)).toBe("—");
});
