#750 Add widow control
This commit is contained in:
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user