Files
docx-js/src/file/table/shading/shading.spec.ts

34 lines
1.0 KiB
TypeScript
Raw Normal View History

2019-03-21 01:06:07 +00:00
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { ShadingType, TableShading } from "./shading";
describe("TableShading", () => {
describe("#constructor", () => {
it("should create", () => {
const shading = new TableShading({});
const tree = new Formatter().format(shading);
2019-03-21 01:06:07 +00:00
expect(tree).to.deep.equal({
"w:shd": {
_attr: {},
},
2019-03-21 01:06:07 +00:00
});
});
it("should create with params", () => {
const shading = new TableShading({ val: ShadingType.PERCENT_40, color: "FF0000", fill: "555555" });
const tree = new Formatter().format(shading);
2019-03-21 01:06:07 +00:00
expect(tree).to.deep.equal({
"w:shd": {
_attr: {
"w:color": "FF0000",
"w:fill": "555555",
"w:val": "pct40",
2019-03-21 01:06:07 +00:00
},
},
2019-03-21 01:06:07 +00:00
});
});
});
});