Breaking Change. Swap arguments around and make default WidthType
This commit is contained in:
@ -176,8 +176,8 @@ describe("Table", () => {
|
||||
});
|
||||
|
||||
describe("#setWidth", () => {
|
||||
it("sets the preferred width on the table", () => {
|
||||
const table = new Table(2, 2).setWidth(WidthType.PERCENTAGE, 1000);
|
||||
it("should set the preferred width on the table", () => {
|
||||
const table = new Table(2, 2).setWidth(1000, WidthType.PERCENTAGE);
|
||||
const tree = new Formatter().format(table);
|
||||
expect(tree)
|
||||
.to.have.property("w:tbl")
|
||||
@ -187,6 +187,15 @@ describe("Table", () => {
|
||||
"w:tblPr": [DEFAULT_TABLE_PROPERTIES, { "w:tblW": [{ _attr: { "w:type": "pct", "w:w": 1000 } }] }],
|
||||
});
|
||||
});
|
||||
|
||||
it("sets the preferred width on the table with a default of AUTO", () => {
|
||||
const table = new Table(2, 2).setWidth(1000);
|
||||
const tree = new Formatter().format(table);
|
||||
|
||||
expect(tree["w:tbl"][0]).to.deep.equal({
|
||||
"w:tblPr": [DEFAULT_TABLE_PROPERTIES, { "w:tblW": [{ _attr: { "w:type": "auto", "w:w": 1000 } }] }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("#setFixedWidthLayout", () => {
|
||||
|
Reference in New Issue
Block a user