added paragraph properties and style tests
This commit is contained in:
@ -28,6 +28,13 @@ describe("Paragraph", () => {
|
||||
}
|
||||
assert.isTrue(true);
|
||||
});
|
||||
|
||||
it("should create have valid properties", () => {
|
||||
var stringifiedJson = JSON.stringify(paragraph);
|
||||
var newJson = JSON.parse(stringifiedJson);
|
||||
|
||||
assert.equal(newJson.root[1].root[0].rootKey, "w:pPr");
|
||||
});
|
||||
});
|
||||
|
||||
describe("#heading1()", () => {
|
||||
|
22
ts/tests/stylesTest.ts
Normal file
22
ts/tests/stylesTest.ts
Normal file
@ -0,0 +1,22 @@
|
||||
/// <reference path="../typings/mocha/mocha.d.ts" />
|
||||
/// <reference path="../typings/chai/chai.d.ts" />
|
||||
import {Styles} from "../styles";
|
||||
import {assert} from "chai";
|
||||
|
||||
describe("Styles", () => {
|
||||
var styles: Styles;
|
||||
|
||||
beforeEach(() => {
|
||||
styles = new Styles();
|
||||
});
|
||||
|
||||
describe('#constructor()', () => {
|
||||
|
||||
it("should not add val with empty constructor", () => {
|
||||
var newAttrs = new Styles();
|
||||
var stringifiedJson = JSON.stringify(newAttrs);
|
||||
var newJson = JSON.parse(stringifiedJson);
|
||||
assert.isUndefined(newJson.root.val);
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user