:test: document defaults & numbering suffix

This commit is contained in:
wangfengming
2020-07-15 14:11:26 +08:00
parent 36e1c5fe6a
commit 3f7ca6bbff
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,45 @@
import { expect } from "chai";
import { DocumentDefaults } from "./document-defaults";
import { Formatter } from "export/formatter";
describe("DocumentDefaults", () => {
it("#constructor", () => {
const defaults = new DocumentDefaults({
paragraph: { spacing: { line: 240 } },
run: { color: "808080" },
});
const tree = new Formatter().format(defaults);
expect(tree).to.deep.equal({
"w:docDefaults": [
{
"w:rPrDefault": [
{
"w:rPr": [
{
"w:color": { _attr: { "w:val": "808080" } },
},
],
},
],
},
{
"w:pPrDefault": [
{
"w:pPr": [
{
"w:spacing": {
_attr: {
"w:line": 240,
},
},
},
],
},
],
},
],
});
});
});