Files
docx-js/src/file/paragraph/run/run-fonts.spec.ts

23 lines
800 B
TypeScript
Raw Normal View History

import { expect } from "chai";
2017-12-19 23:13:11 +00:00
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({
2018-01-23 01:33:12 +00:00
"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({
2018-01-23 01:33:12 +00:00
"w:rFonts": [{ _attr: { "w:ascii": "Times", "w:hAnsi": "Times", "w:hint": "default" } }],
});
});
});
});