Files
docx-js/ts/tests/docx/paragraph/borderTest.ts

32 lines
857 B
TypeScript
Raw Normal View History

import { ThematicBreak } from "../../../docx/paragraph/border";
import { assert } from "chai";
2016-03-29 04:50:23 +01:00
function jsonify(obj: Object) {
2016-05-26 15:08:34 +01:00
let stringifiedJson = JSON.stringify(obj);
2016-03-29 04:50:23 +01:00
return JSON.parse(stringifiedJson);
}
describe("Border", () => {
});
describe("ThematicBreak", () => {
2016-05-26 15:08:34 +01:00
let thematicBreak: ThematicBreak;
2016-03-29 04:50:23 +01:00
beforeEach(() => {
thematicBreak = new ThematicBreak();
});
describe("#constructor()", () => {
it("should create a Thematic Break with correct border properties", () => {
2016-05-26 15:08:34 +01:00
let newJson = jsonify(thematicBreak);
let attributes = {
2016-03-29 04:50:23 +01:00
color: "auto",
space: "1",
val: "single",
sz: "6"
};
2016-05-02 22:39:03 +01:00
assert.equal(JSON.stringify(newJson.root[0].root[0].root), JSON.stringify(attributes));
2016-03-29 04:50:23 +01:00
});
2016-05-26 15:08:34 +01:00
});
2016-03-29 04:50:23 +01:00
});