add paragraph#style method to quickly set the style

This commit is contained in:
felipe
2017-03-09 09:46:12 +01:00
parent f5144e6d72
commit 18ca93e50a
3 changed files with 23 additions and 1 deletions

View File

@ -155,6 +155,23 @@ describe("Paragraph", () => {
});
});
describe("#style", () => {
it("should set the paragraph style to the given styleId", () => {
paragraph.style('myFancyStyle');
const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({
"w:p": [
{
"w:pPr": [
{"_attr": {}},
{"w:pStyle": [{"_attr": {"w:val": "myFancyStyle"}}]},
],
},
]
})
});
});
describe("#indent", () => {
it("should set the paragraph indent to the given values", () => {
paragraph.indent(720);