2016-07-13 00:59:53 +01:00
|
|
|
import * as u from "../../../docx/run/underline";
|
2017-03-07 22:15:53 +00:00
|
|
|
import { TextRun } from "../../../docx/run/text-run";
|
|
|
|
import { assert } from "chai";
|
2016-07-13 00:59:53 +01:00
|
|
|
|
|
|
|
function jsonify(obj: Object) {
|
|
|
|
let stringifiedJson = JSON.stringify(obj);
|
|
|
|
return JSON.parse(stringifiedJson);
|
|
|
|
}
|
|
|
|
|
2016-07-13 18:49:02 +01:00
|
|
|
describe("Underline", () => {
|
2016-07-13 00:59:53 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
|
2016-07-13 18:49:02 +01:00
|
|
|
it("should create a new Underline object with u:u as the rootKey", () => {
|
2016-07-13 00:59:53 +01:00
|
|
|
let underline = new u.Underline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.rootKey, "w:u");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 00:59:53 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
it("should have u:u as the rootKey", () => {
|
2016-07-13 00:59:53 +01:00
|
|
|
let underline = new u.DashDotDotHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.rootKey, "w:u");
|
|
|
|
});
|
|
|
|
|
2016-07-13 18:49:02 +01:00
|
|
|
it("should put value in attribute", () => {
|
2016-07-13 00:59:53 +01:00
|
|
|
let underline = new u.DashDotDotHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
2016-07-13 18:49:02 +01:00
|
|
|
assert.equal(newJson.root[0].root.val, "dashDotDotHeavy");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DashDotHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dashDotHeavy");
|
2016-07-13 00:59:53 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2016-07-13 18:49:02 +01:00
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DashLongHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dashLongHeavy");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DashLongUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dashLong");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DashUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dash");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DotDashUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dotDash");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DotDotDashUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dotDotDash");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DottedHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dottedHeavy");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DottedUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "dotted");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.DoubleUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "double");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.SingleUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "single");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.ThickUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "thick");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.WaveUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "wave");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.WavyDoubleUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "wavyDouble");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.WavyHeavyUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "wavyHeavy");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2016-07-15 18:50:54 +01:00
|
|
|
describe("DashDotDotHeavyUnderline", () => {
|
2016-07-13 18:49:02 +01:00
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
it("should put value in attribute", () => {
|
|
|
|
let underline = new u.WordsUnderline();
|
|
|
|
let newJson = jsonify(underline);
|
|
|
|
assert.equal(newJson.root[0].root.val, "words");
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|