From 1e91d63604320fcc34fb5f03a687f603c3fdf4d2 Mon Sep 17 00:00:00 2001 From: Dolan Miu Date: Mon, 9 May 2016 13:12:28 +0100 Subject: [PATCH] added paragraph properties and style tests --- ts/tests/paragraphTest.ts | 7 +++++++ ts/tests/stylesTest.ts | 22 ++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 ts/tests/stylesTest.ts diff --git a/ts/tests/paragraphTest.ts b/ts/tests/paragraphTest.ts index 2881e28c7c..e9cc196902 100644 --- a/ts/tests/paragraphTest.ts +++ b/ts/tests/paragraphTest.ts @@ -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()", () => { diff --git a/ts/tests/stylesTest.ts b/ts/tests/stylesTest.ts new file mode 100644 index 0000000000..de37b71073 --- /dev/null +++ b/ts/tests/stylesTest.ts @@ -0,0 +1,22 @@ +/// +/// +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); + }); + }); +}); \ No newline at end of file