2019-04-10 01:28:37 -04:00
|
|
|
import { expect } from "chai";
|
2017-09-17 00:00:41 +01:00
|
|
|
|
2019-06-26 02:11:43 +01:00
|
|
|
import { Formatter } from "export/formatter";
|
2021-05-22 03:19:06 +03:00
|
|
|
import { XmlComponent } from "./";
|
2016-07-17 16:03:31 +01:00
|
|
|
|
2018-01-23 01:33:12 +00:00
|
|
|
class TestComponent extends XmlComponent {}
|
2016-07-17 16:03:31 +01:00
|
|
|
|
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", () => {
|
2019-06-26 02:11:43 +01:00
|
|
|
const tree = new Formatter().format(xmlComponent);
|
|
|
|
expect(tree).to.deep.equal({
|
|
|
|
"w:test": {},
|
|
|
|
});
|
2016-07-17 16:03:31 +01:00
|
|
|
});
|
|
|
|
});
|
2017-03-09 20:49:14 +01:00
|
|
|
});
|