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

34 lines
1004 B
TypeScript
Raw Normal View History

2019-03-21 01:06:07 +00:00
import { expect } from "chai";
import { Formatter } from "export/formatter";
import { Shading, ShadingType } from "./shading";
2019-03-21 01:06:07 +00:00
describe("Shading", () => {
2019-03-21 01:06:07 +00:00
describe("#constructor", () => {
it("should create", () => {
const shading = new Shading({});
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 Shading({ 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
});
});
});
});