diff --git a/ts/tests/docx/paragraph/tabStopTests.ts b/ts/tests/docx/paragraph/tabStopTests.ts index 6be4e1cc7b..0db10d2468 100644 --- a/ts/tests/docx/paragraph/tabStopTests.ts +++ b/ts/tests/docx/paragraph/tabStopTests.ts @@ -34,7 +34,7 @@ describe("RightTabStop", () => { }); -describe.only("MaxRightTabStop", () => { +describe("MaxRightTabStop", () => { let tabStop: MaxRightTabStop; beforeEach(() => { diff --git a/ts/tests/docx/xml-components/xmlComponentTests.ts b/ts/tests/docx/xml-components/xmlComponentTests.ts new file mode 100644 index 0000000000..c3980554a0 --- /dev/null +++ b/ts/tests/docx/xml-components/xmlComponentTests.ts @@ -0,0 +1,36 @@ +import {XmlComponent} from "../../../docx/xml-components"; +import {assert} from "chai"; + +function jsonify(obj: Object) { + let stringifiedJson = JSON.stringify(obj); + return JSON.parse(stringifiedJson); +} + +class TestComponent extends XmlComponent { + +} + +describe.only("XmlComponent", () => { + let xmlComponent: TestComponent; + + beforeEach(() => { + xmlComponent = new TestComponent("w:test"); + }); + + describe("#constructor()", () => { + + it("should create an Xml Component which has the correct rootKey", () => { + let newJson = jsonify(xmlComponent); + assert.equal(newJson.rootKey, "w:test"); + }); + }); + + describe("#replaceKey", () => { + + it("should replace the key to the specified root key", () => { + xmlComponent.replaceKey(); + let newJson = jsonify(xmlComponent); + assert.isDefined(newJson["w:test"]); + }); + }); +}); \ No newline at end of file