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({
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:top": {
|
|
|
|
_attr: {
|
|
|
|
"w:type": "dxa",
|
|
|
|
"w:w": 1,
|
2019-03-18 23:50:21 +00:00
|
|
|
},
|
2019-04-09 05:27:18 -04: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({
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:bottom": {
|
|
|
|
_attr: {
|
|
|
|
"w:type": "dxa",
|
|
|
|
"w:w": 1,
|
2019-03-18 23:50:21 +00:00
|
|
|
},
|
2019-04-09 05:27:18 -04: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({
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:start": {
|
|
|
|
_attr: {
|
|
|
|
"w:type": "dxa",
|
|
|
|
"w:w": 1,
|
2019-03-18 23:50:21 +00:00
|
|
|
},
|
2019-04-09 05:27:18 -04: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({
|
2019-04-09 05:27:18 -04:00
|
|
|
"w:end": {
|
|
|
|
_attr: {
|
|
|
|
"w:type": "dxa",
|
|
|
|
"w:w": 1,
|
2019-03-18 23:50:21 +00:00
|
|
|
},
|
2019-04-09 05:27:18 -04:00
|
|
|
},
|
2019-03-18 23:50:21 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|