Files
docx-js/ts/docx/run/run-fonts.spec.ts
Dolan 72e89cfc3c Move tests to respective folders as .spec
This is to keep to standards
2017-09-17 00:00:41 +01:00

24 lines
790 B
TypeScript

import { expect } from "chai";
import { Formatter } from "../../export/formatter";
import { RunFonts } from "./run-fonts";
describe("RunFonts", () => {
describe("#constructor()", () => {
it("uses the font name for both ascii and hAnsi", () => {
const tree = new Formatter().format(new RunFonts("Times"));
expect(tree).to.deep.equal({
"w:rFonts": [{_attr: {"w:ascii": "Times", "w:hAnsi": "Times"}}],
});
});
it("uses hint if given", () => {
const tree = new Formatter().format(new RunFonts("Times", "default"));
expect(tree).to.deep.equal({
"w:rFonts": [{_attr: {"w:ascii": "Times", "w:hAnsi": "Times", "w:hint": "default"}}],
});
});
});
});