:test: document defaults & numbering suffix
This commit is contained in:
45
src/file/styles/defaults/document-defaults.spec.ts
Normal file
45
src/file/styles/defaults/document-defaults.spec.ts
Normal 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,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user