Add tests
This commit is contained in:
@ -5,6 +5,7 @@ import { Formatter } from "export/formatter";
|
||||
import { FooterWrapper } from "file/footer-wrapper";
|
||||
import { HeaderWrapper } from "file/header-wrapper";
|
||||
import { Media } from "file/media";
|
||||
import { LineNumberRestartFormat } from "./line-number";
|
||||
|
||||
import { PageBorderOffsetFrom } from "./page-border";
|
||||
import { PageNumberFormat } from "./page-number";
|
||||
@ -213,5 +214,20 @@ describe("SectionProperties", () => {
|
||||
"w:type": { _attr: { "w:val": "continuous" } },
|
||||
});
|
||||
});
|
||||
|
||||
it("should create section properties line number type", () => {
|
||||
const properties = new SectionProperties({
|
||||
lineNumberCountBy: 2,
|
||||
lineNumberStart: 2,
|
||||
lineNumberRestart: LineNumberRestartFormat.CONTINUOUS,
|
||||
lineNumberDistance: 4,
|
||||
});
|
||||
const tree = new Formatter().format(properties);
|
||||
expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]);
|
||||
const type = tree["w:sectPr"].find((item) => item["w:lnNumType"] !== undefined);
|
||||
expect(type).to.deep.equal({
|
||||
"w:lnNumType": { _attr: { "w:countBy": 2, "w:distance": 4, "w:restart": "continuous", "w:start": 2 } },
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user