diff --git a/ts/tests/docx/run/runTest.ts b/ts/tests/docx/run/runTest.ts index 8077d50c51..1dd496c1f3 100644 --- a/ts/tests/docx/run/runTest.ts +++ b/ts/tests/docx/run/runTest.ts @@ -10,7 +10,7 @@ function jsonify(obj: Object) { return JSON.parse(stringifiedJson); } -describe("Run", () => { +describe.only("Run", () => { let run: Run; beforeEach(() => { @@ -40,17 +40,54 @@ describe("Run", () => { assert.equal(newJson.root[0].root[0].rootKey, "w:u"); }); }); -}); -describe("TextRun", () => { - let run: TextRun; - - describe("#constructor()", () => { - - it("should add text into run", () => { - run = new TextRun("test"); + describe("#smallCaps()", () => { + it("it should add smallCaps to the properties", () => { + run.smallCaps(); let newJson = jsonify(run); - assert.equal(newJson.root[1].root, "test"); + assert.equal(newJson.root[0].root[0].rootKey, "w:smallCaps"); + }); + }); + + describe("#caps()", () => { + it("it should add caps to the properties", () => { + run.allCaps(); + let newJson = jsonify(run); + assert.equal(newJson.root[0].root[0].rootKey, "w:caps"); + }); + }); + + describe("#strike()", () => { + it("it should add strike to the properties", () => { + run.strike(); + let newJson = jsonify(run); + assert.equal(newJson.root[0].root[0].rootKey, "w:strike"); + }); + }); + + describe("#doubleStrike()", () => { + it("it should add caps to the properties", () => { + run.doubleStrike(); + let newJson = jsonify(run); + assert.equal(newJson.root[0].root[0].rootKey, "w:dstrike"); + }); + }); + + describe("#break()", () => { + it("it should add break to the run", () => { + let run = new Run(); + run.break(); + let newJson = jsonify(run); + assert.equal(newJson.root[1].rootKey, "w:br"); + }); + }); + + describe("#tab()", () => { + it("it should add break to the run", () => { + let run = new Run(); + run.tab(); + let newJson = jsonify(run); + assert.equal(newJson.root[1].rootKey, "w:tab"); }); }); }); \ No newline at end of file diff --git a/ts/tests/docx/run/textRunTests.ts b/ts/tests/docx/run/textRunTests.ts new file mode 100644 index 0000000000..a38789f37d --- /dev/null +++ b/ts/tests/docx/run/textRunTests.ts @@ -0,0 +1,20 @@ +import {TextRun} from "../../../docx/run/text-run"; +import {assert} from "chai"; + +function jsonify(obj: Object) { + let stringifiedJson = JSON.stringify(obj); + return JSON.parse(stringifiedJson); +} + +describe("TextRun", () => { + let run: TextRun; + + describe("#constructor()", () => { + + it("should add text into run", () => { + run = new TextRun("test"); + let newJson = jsonify(run); + assert.equal(newJson.root[1].root, "test"); + }); + }); +}); \ No newline at end of file