Alignment of tables

This commit is contained in:
Dolan Miu
2019-11-24 01:22:17 +00:00
parent 1bdc93ef59
commit 8bdbd1de39
5 changed files with 61 additions and 2 deletions

View File

@ -2,6 +2,7 @@ import { expect } from "chai";
import { Formatter } from "export/formatter";
import { AlignmentType } from "../../paragraph";
import { ShadingType } from "../shading";
import { WidthType } from "../table-cell";
import { TableLayoutType } from "./table-layout";
@ -92,4 +93,23 @@ describe("TableProperties", () => {
});
});
});
describe("#setAlignment", () => {
it("sets the shading of the table", () => {
const tp = new TableProperties();
tp.setAlignment(AlignmentType.CENTER);
const tree = new Formatter().format(tp);
expect(tree).to.deep.equal({
"w:tblPr": [
{
"w:jc": {
_attr: {
"w:val": "center",
},
},
},
],
});
});
});
});