move indent.ts over to paragraph and add a #indent method

This commit is contained in:
felipe
2017-03-09 09:18:17 +01:00
parent 77255c9d5e
commit 2684f16579
4 changed files with 26 additions and 3 deletions

View File

@ -136,7 +136,6 @@ describe("Paragraph", () => {
paragraph.setNumbering(letterNumbering, 0);
const tree = new Formatter().format(paragraph);
console.log(JSON.stringify(tree, null, 2));
expect(tree).to.deep.equal({
"w:p": [
{
@ -155,4 +154,21 @@ describe("Paragraph", () => {
})
});
});
describe("#indent", () => {
it("should set the paragraph indent to the given values", () => {
paragraph.indent(720);
const tree = new Formatter().format(paragraph);
expect(tree).to.deep.equal({
"w:p": [
{
"w:pPr": [
{"_attr": {}},
{"w:ind": [{"_attr": {"w:left": 720}}]},
],
},
]
})
});
});
});