2017-03-07 22:15:53 +00:00
|
|
|
import { assert } from "chai";
|
2017-03-09 22:56:08 +00:00
|
|
|
import { XmlComponent } from "../../../docx/xml-components";
|
|
|
|
import { Utility } from "../../utility";
|
2016-07-17 16:03:31 +01:00
|
|
|
|
|
|
|
class TestComponent extends XmlComponent {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-07-17 16:18:20 +01:00
|
|
|
describe("XmlComponent", () => {
|
2016-07-17 16:03:31 +01:00
|
|
|
let xmlComponent: TestComponent;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
xmlComponent = new TestComponent("w:test");
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("#constructor()", () => {
|
|
|
|
|
|
|
|
it("should create an Xml Component which has the correct rootKey", () => {
|
2017-03-09 22:56:08 +00:00
|
|
|
const newJson = Utility.jsonify(xmlComponent);
|
2016-07-17 16:03:31 +01:00
|
|
|
assert.equal(newJson.rootKey, "w:test");
|
|
|
|
});
|
|
|
|
});
|
2017-03-09 20:49:14 +01:00
|
|
|
});
|