added #color and #size methods to Run

This commit is contained in:
felipe
2017-03-12 17:31:36 +01:00
parent d85c6ce56a
commit 3dbd917667
2 changed files with 35 additions and 1 deletions

View File

@ -117,4 +117,28 @@ describe("Run", () => {
});
});
});
describe("#color", () => {
it("should set the run to the color given", () => {
run.color("001122");
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{"w:rPr": [{"w:color": [{_attr: {"w:val": "001122"}}]}]},
],
});
});
});
describe("#size", () => {
it("should set the run to the given size", () => {
run.size(24);
const tree = new Formatter().format(run);
expect(tree).to.deep.equal({
"w:r": [
{"w:rPr": [{"w:sz": [{_attr: {"w:val": 24}}]}]},
],
});
});
});
});