:test: Font for eastAsia

This commit is contained in:
wangfengming
2020-06-07 12:38:31 +08:00
parent fdfce79e87
commit 8a3c8d4664
5 changed files with 137 additions and 3 deletions

View File

@ -417,7 +417,7 @@ describe("AbstractNumbering", () => {
});
});
it("#font", () => {
it("#font by name", () => {
const abstractNumbering = new AbstractNumbering(1, [
{
level: 0,
@ -447,6 +447,37 @@ describe("AbstractNumbering", () => {
});
});
it("#font for ascii and eastAsia", () => {
const abstractNumbering = new AbstractNumbering(1, [
{
level: 0,
format: "lowerRoman",
text: "%0.",
style: {
run: {
font: {
ascii: "Times",
eastAsia: "KaiTi",
},
},
},
},
]);
const tree = new Formatter().format(abstractNumbering);
expect(tree["w:abstractNum"][2]["w:lvl"]).to.include({
"w:rPr": [
{
"w:rFonts": {
_attr: {
"w:ascii": "Times",
"w:eastAsia": "KaiTi",
},
},
},
],
});
});
it("#bold", () => {
const abstractNumbering = new AbstractNumbering(1, [
{