Files
docx-js/src/file/table/table-cell/cell-margain/cell-margain.spec.ts

74 lines
2.1 KiB
TypeScript
Raw Normal View History

2019-03-18 23:50:21 +00:00
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { BottomCellMargain, LeftCellMargain, RightCellMargain, TopCellMargain } from "./cell-margain";
describe("TopCellMargain", () => {
describe("#constructor", () => {
it("should create", () => {
const cellMargain = new TopCellMargain(1);
const tree = new Formatter().format(cellMargain);
expect(tree).to.deep.equal({
"w:top": {
_attr: {
"w:type": "dxa",
"w:w": 1,
2019-03-18 23:50:21 +00:00
},
},
2019-03-18 23:50:21 +00:00
});
});
});
});
describe("BottomCellMargain", () => {
describe("#constructor", () => {
it("should create", () => {
const cellMargain = new BottomCellMargain(1);
const tree = new Formatter().format(cellMargain);
expect(tree).to.deep.equal({
"w:bottom": {
_attr: {
"w:type": "dxa",
"w:w": 1,
2019-03-18 23:50:21 +00:00
},
},
2019-03-18 23:50:21 +00:00
});
});
});
});
describe("LeftCellMargain", () => {
describe("#constructor", () => {
it("should create", () => {
const cellMargain = new LeftCellMargain(1);
const tree = new Formatter().format(cellMargain);
expect(tree).to.deep.equal({
"w:start": {
_attr: {
"w:type": "dxa",
"w:w": 1,
2019-03-18 23:50:21 +00:00
},
},
2019-03-18 23:50:21 +00:00
});
});
});
});
describe("RightCellMargain", () => {
describe("#constructor", () => {
it("should create", () => {
const cellMargain = new RightCellMargain(1);
const tree = new Formatter().format(cellMargain);
expect(tree).to.deep.equal({
"w:end": {
_attr: {
"w:type": "dxa",
"w:w": 1,
2019-03-18 23:50:21 +00:00
},
},
2019-03-18 23:50:21 +00:00
});
});
});
});