2016-03-30 02:55:11 +01:00
|
|
|
/// <reference path="../typings/mocha/mocha.d.ts" />
|
|
|
|
/// <reference path="../typings/chai/chai.d.ts" />
|
|
|
|
import {Style} from "../docx/paragraph/style";
|
|
|
|
import {assert} from "chai";
|
|
|
|
|
|
|
|
function jsonify(obj: Object) {
|
|
|
|
var stringifiedJson = JSON.stringify(obj);
|
|
|
|
return JSON.parse(stringifiedJson);
|
|
|
|
}
|
|
|
|
|
2016-04-09 04:53:42 +01:00
|
|
|
describe("ParagraphStyle", () => {
|
2016-03-30 02:55:11 +01:00
|
|
|
var style: Style;
|
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should create a style with given value", () => {
|
|
|
|
style = new Style("test");
|
|
|
|
var newJson = jsonify(style);
|
2016-04-09 04:53:42 +01:00
|
|
|
assert(newJson.pStyle[0]._attr.val === "test");
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should create a style with blank val", () => {
|
|
|
|
style = new Style("");
|
|
|
|
var newJson = jsonify(style);
|
2016-04-09 04:53:42 +01:00
|
|
|
assert(newJson.pStyle[0]._attr.val === "");
|
2016-03-30 02:55:11 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|