added styles

This commit is contained in:
Dolan Miu
2016-04-09 02:04:53 +01:00
parent e9696927bc
commit bf928393b5
9 changed files with 125 additions and 1 deletions

View File

@ -0,0 +1,28 @@
/// <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);
}
describe("Style", () => {
var style: Style;
describe("#constructor()", () => {
it("should create a style with given value", () => {
style = new Style("test");
var newJson = jsonify(style);
assert(newJson.pStyle[0]._attrs.val === "test");
});
it("should create a style with blank val", () => {
style = new Style("");
var newJson = jsonify(style);
assert(newJson.pStyle[0]._attrs.val === "");
});
});
});