added styles
This commit is contained in:
28
ts/tests/paragraphStyleTest.ts
Normal file
28
ts/tests/paragraphStyleTest.ts
Normal 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 === "");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Reference in New Issue
Block a user