This commit is contained in:
Dolan
2017-03-09 22:56:08 +00:00
parent 5fac776dca
commit 7022b39d2e
21 changed files with 138 additions and 181 deletions

View File

@ -1,5 +1,5 @@
import { Attributes } from "../../../docx/xml-components";
import { assert } from "chai";
import { Attributes } from "../../../docx/xml-components";
describe("Attribute", () => {
let attributes: Attributes;
@ -11,28 +11,28 @@ describe("Attribute", () => {
describe("#constructor()", () => {
it("should not add val with empty constructor", () => {
let newAttrs = new Attributes();
let stringifiedJson = JSON.stringify(newAttrs);
let newJson = JSON.parse(stringifiedJson);
const newAttrs = new Attributes();
const stringifiedJson = JSON.stringify(newAttrs);
const newJson = JSON.parse(stringifiedJson);
assert.isUndefined(newJson.root.val);
});
it("should have val as defined with populated constructor", () => {
let newAttrs = new Attributes({
val: "test"
const newAttrs = new Attributes({
val: "test",
});
let stringifiedJson = JSON.stringify(newAttrs);
let newJson = JSON.parse(stringifiedJson);
const stringifiedJson = JSON.stringify(newAttrs);
const newJson = JSON.parse(stringifiedJson);
assert.equal(newJson.root.val, "test");
});
it("should have space value as defined with populated constructor", () => {
let newAttrs = new Attributes({
space: "spaceTest"
const newAttrs = new Attributes({
space: "spaceTest",
});
let stringifiedJson = JSON.stringify(newAttrs);
let newJson = JSON.parse(stringifiedJson);
const stringifiedJson = JSON.stringify(newAttrs);
const newJson = JSON.parse(stringifiedJson);
assert.equal(newJson.root.space, "spaceTest");
});
});
});
});