2017-03-07 22:15:53 +00:00
|
|
|
import { assert } from "chai";
|
2017-09-17 00:00:41 +01:00
|
|
|
|
2017-09-30 01:52:37 +01:00
|
|
|
import { Utility } from "../../../tests/utility";
|
2017-09-17 00:00:41 +01:00
|
|
|
import { ThematicBreak } from "./border";
|
2016-03-29 04:50:23 +01:00
|
|
|
|
|
|
|
describe("Border", () => {
|
2017-03-09 22:31:55 +00:00
|
|
|
// TODO: Need tests here
|
2016-03-29 04:50:23 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
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()", () => {
|
2017-09-30 18:00:06 +01:00
|
|
|
it("should create valid JSON", () => {
|
|
|
|
const stringifiedJson = JSON.stringify(thematicBreak);
|
|
|
|
let newJson;
|
|
|
|
|
|
|
|
try {
|
|
|
|
newJson = JSON.parse(stringifiedJson);
|
|
|
|
} catch (e) {
|
|
|
|
assert.isTrue(false);
|
|
|
|
}
|
|
|
|
assert.isTrue(true);
|
|
|
|
});
|
|
|
|
|
2016-03-29 04:50:23 +01:00
|
|
|
it("should create a Thematic Break with correct border properties", () => {
|
2017-03-09 22:31:55 +00:00
|
|
|
const newJson = Utility.jsonify(thematicBreak);
|
|
|
|
const attributes = {
|
2016-03-29 04:50:23 +01:00
|
|
|
color: "auto",
|
|
|
|
space: "1",
|
|
|
|
val: "single",
|
2017-03-09 22:31:55 +00:00
|
|
|
sz: "6",
|
2016-03-29 04:50:23 +01:00
|
|
|
};
|
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
|
|
|
});
|
2017-03-09 22:31:55 +00:00
|
|
|
});
|