2017-03-07 22:15:53 +00:00
|
|
|
import { Style } from "../../../docx/paragraph/style";
|
|
|
|
import { assert } from "chai";
|
2016-03-30 02:55:11 +01:00
|
|
|
|
|
|
|
function jsonify(obj: Object) {
|
2016-05-26 15:08:34 +01:00
|
|
|
let stringifiedJson = JSON.stringify(obj);
|
2016-03-30 02:55:11 +01:00
|
|
|
return JSON.parse(stringifiedJson);
|
|
|
|
}
|
|
|
|
|
2016-04-09 04:53:42 +01:00
|
|
|
describe("ParagraphStyle", () => {
|
2016-05-26 15:08:34 +01:00
|
|
|
let style: Style;
|
2016-03-30 02:55:11 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create a style with given value", () => {
|
|
|
|
style = new Style("test");
|
2016-05-26 15:08:34 +01:00
|
|
|
let newJson = jsonify(style);
|
2016-05-01 22:24:20 +01:00
|
|
|
assert.equal(newJson.root[0].root.val, "test");
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should create a style with blank val", () => {
|
|
|
|
style = new Style("");
|
2016-05-26 15:08:34 +01:00
|
|
|
let newJson = jsonify(style);
|
2016-05-01 22:24:20 +01:00
|
|
|
assert.equal(newJson.root[0].root.val, "");
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|