Add BuilderElement and lang

This commit is contained in:
Dolan
2022-12-18 00:52:29 +00:00
parent af3b7f2613
commit 03d5152e7c
4 changed files with 105 additions and 5 deletions

View File

@ -580,5 +580,35 @@ describe("Run", () => {
});
});
});
describe("#language", () => {
it("should correctly set the language", () => {
const run = new Run({
language: {
value: "en-US",
eastAsia: "zh-CN",
bidirectional: "ar-SA",
},
});
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{
"w:rPr": [
{
"w:lang": {
_attr: {
"w:val": "en-US",
"w:eastAsia": "zh-CN",
"w:bidi": "ar-SA",
},
},
},
],
},
],
});
});
});
});
});