diff --git a/ts/docx/run/script.ts b/ts/docx/run/script.ts
index 2dd10da783..60a695e652 100644
--- a/ts/docx/run/script.ts
+++ b/ts/docx/run/script.ts
@@ -5,7 +5,7 @@ abstract class VerticalAlign extends XmlComponent {
constructor(type: string) {
super("w:vertAlign");
this.root.push(new Attributes({
- val: "superscript"
+ val: type
}));
}
}
diff --git a/ts/tests/docx/paragraph/pageBreakTests.ts b/ts/tests/docx/paragraph/pageBreakTests.ts
index bf6ea35acf..5278fcd9f2 100644
--- a/ts/tests/docx/paragraph/pageBreakTests.ts
+++ b/ts/tests/docx/paragraph/pageBreakTests.ts
@@ -14,7 +14,7 @@ describe("PageBreak", () => {
});
describe("#constructor()", () => {
- it("should create a Tab Stop with correct attributes", () => {
+ it("should create a Page Break with correct attributes", () => {
let newJson = jsonify(pageBreak);
let attributes = {
type: "page"
diff --git a/ts/tests/docx/run/breakTests.ts b/ts/tests/docx/run/breakTests.ts
index 56fad8342e..8233316ddc 100644
--- a/ts/tests/docx/run/breakTests.ts
+++ b/ts/tests/docx/run/breakTests.ts
@@ -6,7 +6,7 @@ function jsonify(obj: Object) {
return JSON.parse(stringifiedJson);
}
-describe.only("Break", () => {
+describe("Break", () => {
let currentBreak: Break;
beforeEach(() => {
diff --git a/ts/tests/docx/run/runTest.ts b/ts/tests/docx/run/runTest.ts
index 0a6154b9cf..182be2b8f0 100644
--- a/ts/tests/docx/run/runTest.ts
+++ b/ts/tests/docx/run/runTest.ts
@@ -1,6 +1,3 @@
-///
-///
-
import {Run} from "../../../docx/run";
import {TextRun} from "../../../docx/run/text-run";
import {assert} from "chai";
diff --git a/ts/tests/docx/run/scriptTests.ts b/ts/tests/docx/run/scriptTests.ts
new file mode 100644
index 0000000000..9f09fd79eb
--- /dev/null
+++ b/ts/tests/docx/run/scriptTests.ts
@@ -0,0 +1,53 @@
+import {SubScript, SuperScript} from "../../../docx/run/script";
+import {assert} from "chai";
+
+function jsonify(obj: Object) {
+ let stringifiedJson = JSON.stringify(obj);
+ return JSON.parse(stringifiedJson);
+}
+
+describe("SubScript", () => {
+ let subScript: SubScript;
+
+ beforeEach(() => {
+ subScript = new SubScript();
+ });
+
+ describe("#constructor()", () => {
+ it("should create a Sub Script with correct attributes", () => {
+ let newJson = jsonify(subScript);
+ let attributes = {
+ val: "subscript"
+ };
+ assert.equal(JSON.stringify(newJson.root[0].root), JSON.stringify(attributes));
+ });
+
+ it("should create a Sub Script with correct root key", () => {
+ let newJson = jsonify(subScript);
+ assert.equal(newJson.rootKey, "w:vertAlign");
+ });
+ });
+});
+
+describe("SuperScript", () => {
+ let superScript: SuperScript;
+
+ beforeEach(() => {
+ superScript = new SuperScript();
+ });
+
+ describe("#constructor()", () => {
+ it("should create a Super Script with correct attributes", () => {
+ let newJson = jsonify(superScript);
+ let attributes = {
+ val: "superscript"
+ };
+ assert.equal(JSON.stringify(newJson.root[0].root), JSON.stringify(attributes));
+ });
+
+ it("should create a Super Script with correct root key", () => {
+ let newJson = jsonify(superScript);
+ assert.equal(newJson.rootKey, "w:vertAlign");
+ });
+ });
+});
\ No newline at end of file
diff --git a/ts/tests/docx/run/strikeTests.ts b/ts/tests/docx/run/strikeTests.ts
new file mode 100644
index 0000000000..e1a0d6d880
--- /dev/null
+++ b/ts/tests/docx/run/strikeTests.ts
@@ -0,0 +1,37 @@
+import {Strike, DoubleStrike} from "../../../docx/run/strike";
+import {assert} from "chai";
+
+function jsonify(obj: Object) {
+ let stringifiedJson = JSON.stringify(obj);
+ return JSON.parse(stringifiedJson);
+}
+
+describe("Strike", () => {
+ let strike: Strike;
+
+ beforeEach(() => {
+ strike = new Strike();
+ });
+
+ describe("#constructor()", () => {
+ it("should create a Strike with correct root key", () => {
+ let newJson = jsonify(strike);
+ assert.equal(newJson.rootKey, "w:strike");
+ });
+ });
+});
+
+describe("DoubleStrike", () => {
+ let strike: DoubleStrike;
+
+ beforeEach(() => {
+ strike = new DoubleStrike();
+ });
+
+ describe("#constructor()", () => {
+ it("should create a Double Strike with correct root key", () => {
+ let newJson = jsonify(strike);
+ assert.equal(newJson.rootKey, "w:dstrike");
+ });
+ });
+});
\ No newline at end of file
diff --git a/ts/tests/docx/run/tabTests.ts b/ts/tests/docx/run/tabTests.ts
new file mode 100644
index 0000000000..86a0b3e2be
--- /dev/null
+++ b/ts/tests/docx/run/tabTests.ts
@@ -0,0 +1,22 @@
+import {Tab} from "../../../docx/run/tab";
+import {assert} from "chai";
+
+function jsonify(obj: Object) {
+ let stringifiedJson = JSON.stringify(obj);
+ return JSON.parse(stringifiedJson);
+}
+
+describe("Tab", () => {
+ let tab: Tab;
+
+ beforeEach(() => {
+ tab = new Tab();
+ });
+
+ describe("#constructor()", () => {
+ it("should create a Tab with correct root key", () => {
+ let newJson = jsonify(tab);
+ assert.equal(newJson.rootKey, "w:tab");
+ });
+ });
+});
\ No newline at end of file
diff --git a/ts/tests/docx/xml-components/xmlUnitTests.ts b/ts/tests/docx/xml-components/xmlUnitTests.ts
new file mode 100644
index 0000000000..a3e35f6bb9
--- /dev/null
+++ b/ts/tests/docx/xml-components/xmlUnitTests.ts
@@ -0,0 +1,36 @@
+import {XmlUnitComponent} from "../../../docx/xml-components";
+import {assert} from "chai";
+
+function jsonify(obj: Object) {
+ let stringifiedJson = JSON.stringify(obj);
+ return JSON.parse(stringifiedJson);
+}
+
+class TestComponent extends XmlUnitComponent {
+
+}
+
+describe("XmlUnitComponent", () => {
+ 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 not replace the key to the specified root key as root is null", () => {
+ xmlComponent.replaceKey();
+ let newJson = jsonify(xmlComponent);
+ assert.isUndefined(newJson["w:test"]);
+ });
+ });
+});
\ No newline at end of file