2019-03-18 23:50:21 +00:00
|
|
|
import { expect } from "chai";
|
|
|
|
|
|
|
|
import { Formatter } from "export/formatter";
|
|
|
|
|
2019-04-18 13:55:18 +10:00
|
|
|
import { BottomCellMargin, LeftCellMargin, RightCellMargin, TopCellMargin } from "./cell-margin";
|
2019-03-18 23:50:21 +00:00
|
|
|
|
2019-04-18 13:55:18 +10:00
|
|
|
describe("TopCellMargin", () => {
|
2019-03-18 23:50:21 +00:00
|
|
|
describe("#constructor", () => {
|
|
|
|
it("should create", () => {
|
2019-04-18 13:55:18 +10:00
|
|
|
const cellMargin = new TopCellMargin(1);
|
|
|
|
const tree = new Formatter().format(cellMargin);
|
2019-03-18 23:50:21 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-04-18 13:55:18 +10:00
|
|
|
describe("BottomCellMargin", () => {
|
2019-03-18 23:50:21 +00:00
|
|
|
describe("#constructor", () => {
|
|
|
|
it("should create", () => {
|
2019-04-18 13:55:18 +10:00
|
|
|
const cellMargin = new BottomCellMargin(1);
|
|
|
|
const tree = new Formatter().format(cellMargin);
|
2019-03-18 23:50:21 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-04-18 13:55:18 +10:00
|
|
|
describe("LeftCellMargin", () => {
|
2019-03-18 23:50:21 +00:00
|
|
|
describe("#constructor", () => {
|
|
|
|
it("should create", () => {
|
2019-04-18 13:55:18 +10:00
|
|
|
const cellMargin = new LeftCellMargin(1);
|
|
|
|
const tree = new Formatter().format(cellMargin);
|
2019-03-18 23:50:21 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2019-04-18 13:55:18 +10:00
|
|
|
describe("RightCellMargin", () => {
|
2019-03-18 23:50:21 +00:00
|
|
|
describe("#constructor", () => {
|
|
|
|
it("should create", () => {
|
2019-04-18 13:55:18 +10:00
|
|
|
const cellMargin = new RightCellMargin(1);
|
|
|
|
const tree = new Formatter().format(cellMargin);
|
2019-03-18 23:50:21 +00:00
|
|
|
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
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|