Improve tests
This commit is contained in:
@ -2,11 +2,11 @@ import { expect } from "chai";
|
||||
|
||||
import { Formatter } from "export/formatter";
|
||||
|
||||
import { HeightRule } from "file/table/table-row/table-row-height";
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
import { TableCell } from "../table-cell";
|
||||
import { TableRow } from "./table-row";
|
||||
|
||||
import { EMPTY_OBJECT } from "file/xml-components";
|
||||
|
||||
describe("TableRow", () => {
|
||||
describe("#constructor", () => {
|
||||
it("should create with no cells", () => {
|
||||
@ -67,4 +67,28 @@ describe("TableRow", () => {
|
||||
expect(() => tableRow.getCell(1)).to.throw();
|
||||
});
|
||||
});
|
||||
|
||||
describe("#setHeight", () => {
|
||||
it("should set row height", () => {
|
||||
const tableRow = new TableRow([]);
|
||||
tableRow.setHeight(100, HeightRule.EXACT);
|
||||
const tree = new Formatter().format(tableRow);
|
||||
expect(tree).to.deep.equal({
|
||||
"w:tr": [
|
||||
{
|
||||
"w:trPr": [
|
||||
{
|
||||
"w:trHeight": {
|
||||
_attr: {
|
||||
"w:hRule": "exact",
|
||||
"w:val": 100,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user