2016-03-31 23:01:20 +01:00
|
|
|
/// <reference path="../typings/mocha/mocha.d.ts" />
|
|
|
|
/// <reference path="../typings/chai/chai.d.ts" />
|
|
|
|
import {Body} from "../docx/document/body";
|
|
|
|
import {assert} from "chai";
|
|
|
|
|
|
|
|
function jsonify(obj: Object) {
|
|
|
|
var stringifiedJson = JSON.stringify(obj);
|
|
|
|
return JSON.parse(stringifiedJson);
|
|
|
|
}
|
|
|
|
|
2016-04-03 05:24:56 +01:00
|
|
|
describe("Body", () => {
|
2016-03-31 23:01:20 +01:00
|
|
|
var body: Body;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
body = new Body();
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('#constructor()', () => {
|
2016-04-01 00:22:44 +01:00
|
|
|
|
|
|
|
it("should create the Section Properties", () => {
|
|
|
|
var newJson = jsonify(body);
|
|
|
|
assert.isDefined(newJson.body[0].sectPr);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should create the Page Size", () => {
|
|
|
|
var newJson = jsonify(body);
|
|
|
|
assert.isDefined(newJson.body[1].pgSz);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should create the Page Margin", () => {
|
|
|
|
var newJson = jsonify(body);
|
|
|
|
assert.isDefined(newJson.body[2].pgMar);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should create the Columns", () => {
|
|
|
|
var newJson = jsonify(body);
|
|
|
|
assert.isDefined(newJson.body[3].cols);
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should create the Document Grid", () => {
|
|
|
|
var newJson = jsonify(body);
|
|
|
|
assert.isDefined(newJson.body[4].docGrid);
|
2016-03-31 23:36:42 +01:00
|
|
|
});
|
2016-03-31 23:01:20 +01:00
|
|
|
});
|
|
|
|
});
|