clean up underlineTests linter warnings

This commit is contained in:
felipe
2017-03-09 12:36:33 +01:00
parent 3b18b8267a
commit f06094c91d

View File

@ -1,9 +1,10 @@
import * as u from "../../../docx/run/underline";
import { TextRun } from "../../../docx/run/text-run";
import { assert } from "chai"; import { assert } from "chai";
function jsonify(obj: Object) { import { TextRun } from "../../../docx/run/text-run";
let stringifiedJson = JSON.stringify(obj); import * as u from "../../../docx/run/underline";
function jsonify(obj: object) {
const stringifiedJson = JSON.stringify(obj);
return JSON.parse(stringifiedJson); return JSON.parse(stringifiedJson);
} }
@ -12,8 +13,8 @@ describe("Underline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should create a new Underline object with u:u as the rootKey", () => { it("should create a new Underline object with u:u as the rootKey", () => {
let underline = new u.Underline(); const underline = new u.Underline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.rootKey, "w:u"); assert.equal(newJson.rootKey, "w:u");
}); });
}); });
@ -23,14 +24,14 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should have u:u as the rootKey", () => { it("should have u:u as the rootKey", () => {
let underline = new u.DashDotDotHeavyUnderline(); const underline = new u.DashDotDotHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.rootKey, "w:u"); assert.equal(newJson.rootKey, "w:u");
}); });
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DashDotDotHeavyUnderline(); const underline = new u.DashDotDotHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dashDotDotHeavy"); assert.equal(newJson.root[0].root.val, "dashDotDotHeavy");
}); });
}); });
@ -40,8 +41,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DashDotHeavyUnderline(); const underline = new u.DashDotHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dashDotHeavy"); assert.equal(newJson.root[0].root.val, "dashDotHeavy");
}); });
}); });
@ -51,8 +52,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DashLongHeavyUnderline(); const underline = new u.DashLongHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dashLongHeavy"); assert.equal(newJson.root[0].root.val, "dashLongHeavy");
}); });
}); });
@ -62,8 +63,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DashLongUnderline(); const underline = new u.DashLongUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dashLong"); assert.equal(newJson.root[0].root.val, "dashLong");
}); });
}); });
@ -73,8 +74,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DashUnderline(); const underline = new u.DashUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dash"); assert.equal(newJson.root[0].root.val, "dash");
}); });
}); });
@ -84,8 +85,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DotDashUnderline(); const underline = new u.DotDashUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dotDash"); assert.equal(newJson.root[0].root.val, "dotDash");
}); });
}); });
@ -95,8 +96,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DotDotDashUnderline(); const underline = new u.DotDotDashUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dotDotDash"); assert.equal(newJson.root[0].root.val, "dotDotDash");
}); });
}); });
@ -106,8 +107,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DottedHeavyUnderline(); const underline = new u.DottedHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dottedHeavy"); assert.equal(newJson.root[0].root.val, "dottedHeavy");
}); });
}); });
@ -117,8 +118,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DottedUnderline(); const underline = new u.DottedUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "dotted"); assert.equal(newJson.root[0].root.val, "dotted");
}); });
}); });
@ -128,8 +129,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.DoubleUnderline(); const underline = new u.DoubleUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "double"); assert.equal(newJson.root[0].root.val, "double");
}); });
}); });
@ -139,8 +140,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.SingleUnderline(); const underline = new u.SingleUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "single"); assert.equal(newJson.root[0].root.val, "single");
}); });
}); });
@ -150,8 +151,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.ThickUnderline(); const underline = new u.ThickUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "thick"); assert.equal(newJson.root[0].root.val, "thick");
}); });
}); });
@ -161,8 +162,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.WaveUnderline(); const underline = new u.WaveUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "wave"); assert.equal(newJson.root[0].root.val, "wave");
}); });
}); });
@ -172,8 +173,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.WavyDoubleUnderline(); const underline = new u.WavyDoubleUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "wavyDouble"); assert.equal(newJson.root[0].root.val, "wavyDouble");
}); });
}); });
@ -183,8 +184,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.WavyHeavyUnderline(); const underline = new u.WavyHeavyUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "wavyHeavy"); assert.equal(newJson.root[0].root.val, "wavyHeavy");
}); });
}); });
@ -194,8 +195,8 @@ describe("DashDotDotHeavyUnderline", () => {
describe("#constructor()", () => { describe("#constructor()", () => {
it("should put value in attribute", () => { it("should put value in attribute", () => {
let underline = new u.WordsUnderline(); const underline = new u.WordsUnderline();
let newJson = jsonify(underline); const newJson = jsonify(underline);
assert.equal(newJson.root[0].root.val, "words"); assert.equal(newJson.root[0].root.val, "words");
}); });
}); });