Fix style

This commit is contained in:
巴里切罗
2018-07-24 12:37:15 +08:00
parent 1fad9a666e
commit 974eb510ef
4 changed files with 18 additions and 4 deletions

View File

@ -297,7 +297,9 @@ describe("AbstractNumbering", () => {
const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").font("Times"); const level = abstractNumbering.createLevel(0, "lowerRoman", "%0.").font("Times");
const tree = new Formatter().format(level); const tree = new Formatter().format(level);
expect(tree["w:lvl"]).to.include({ expect(tree["w:lvl"]).to.include({
"w:rPr": [{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] }], "w:rPr": [
{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] },
],
}); });
}); });

View File

@ -15,7 +15,9 @@ describe("RunFonts", () => {
it("uses hint if given", () => { it("uses hint if given", () => {
const tree = new Formatter().format(new RunFonts("Times", "default")); const tree = new Formatter().format(new RunFonts("Times", "default"));
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times", "w:hint": "default" } }], "w:rFonts": [
{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times", "w:hint": "default" } },
],
}); });
}); });
}); });

View File

@ -108,7 +108,13 @@ describe("Run", () => {
run.font("Times"); run.font("Times");
const tree = new Formatter().format(run); const tree = new Formatter().format(run);
expect(tree).to.deep.equal({ expect(tree).to.deep.equal({
"w:r": [{ "w:rPr": [{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] }] }], "w:r": [
{
"w:rPr": [
{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] },
],
},
],
}); });
}); });
}); });

View File

@ -459,7 +459,11 @@ describe("ParagraphStyle", () => {
"w:style": [ "w:style": [
{ _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } }, { _attr: { "w:type": "paragraph", "w:styleId": "myStyleId" } },
{ "w:pPr": [] }, { "w:pPr": [] },
{ "w:rPr": [{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] }] }, {
"w:rPr": [
{ "w:rFonts": [{ _attr: { "w:ascii": "Times", "w:cs": "Times", "w:eastAsia": "Times", "w:hAnsi": "Times" } }] },
],
},
], ],
}); });
}); });