#1324 Fixes Bi-directional re-factor issue

This commit is contained in:
Dolan Miu
2021-12-02 17:24:19 +00:00
parent 1385a5d702
commit 74fbc715e9
2 changed files with 27 additions and 1 deletions

View File

@ -91,5 +91,31 @@ describe("ParagraphProperties", () => {
],
});
});
it("should create with bidirectional", () => {
const properties = new ParagraphProperties({
bidirectional: 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:bidi": {},
},
],
});
});
});
});

View File

@ -146,7 +146,7 @@ export class ParagraphProperties extends IgnoreIfEmptyXmlComponent {
}
if (options.bidirectional !== undefined) {
this.push(new OnOffElement("w:bidi", options.contextualSpacing));
this.push(new OnOffElement("w:bidi", options.bidirectional));
}
if (options.spacing) {