added paragraph styles

This commit is contained in:
Dolan Miu
2016-03-29 04:10:33 +01:00
parent 18c92426ad
commit c2b215e81b
6 changed files with 214 additions and 46 deletions

29
ts/tests/attributeTest.ts Normal file
View File

@ -0,0 +1,29 @@
/// <reference path="../typings/mocha/mocha.d.ts" />
/// <reference path="../typings/chai/chai.d.ts" />
import {Attributes} from "../docx/xml-components/p";
import {assert} from "chai";
describe('Attribute', () => {
var attributes: Attributes;
beforeEach(() => {
attributes = new Attributes();
});
describe('#constructor()', () => {
it("should not add val with empty constructor", () => {
var newAttrs = new Attributes();
var stringifiedJson = JSON.stringify(newAttrs);
var newJson = JSON.parse(stringifiedJson);
assert.isUndefined(newJson._attrs.val);
});
it("should have val as defined with populated constructor", () => {
var newAttrs = new Attributes("test");
var stringifiedJson = JSON.stringify(newAttrs);
var newJson = JSON.parse(stringifiedJson);
assert(newJson._attrs.val === "test");
});
});
});