#750 Add widow control

This commit is contained in:
Dolan
2021-03-13 04:07:44 +00:00
parent 2391375ac0
commit 8724fbe7a7
6 changed files with 93 additions and 5 deletions

View File

@ -14,7 +14,7 @@ describe("ParagraphProperties", () => {
expect(() => new Formatter().format(properties)).to.throw("XMLComponent did not format correctly");
});
it("should create", () => {
it("should create with numbering", () => {
const properties = new ParagraphProperties({
numbering: {
reference: "test-reference",
@ -65,5 +65,35 @@ describe("ParagraphProperties", () => {
],
});
});
it("should create with widowControl", () => {
const properties = new ParagraphProperties({
widowControl: true,
});
const tree = new Formatter().format(properties, {
// tslint:disable-next-line: no-object-literal-type-assertion
file: {
Numbering: {
createConcreteNumberingInstance: (_: string, __: number) => {
return;
},
},
} as File,
// tslint:disable-next-line: no-object-literal-type-assertion
viewWrapper: new DocumentWrapper({ background: {} }),
});
expect(tree).to.deep.equal({
"w:pPr": [
{
"w:widowControl": {
_attr: {
"w:val": true,
},
},
},
],
});
});
});
});