styles: support for external styles. parsing external styles.
This commit is contained in:
34
src/file/xml-components/imported-xml-component.spec.ts
Normal file
34
src/file/xml-components/imported-xml-component.spec.ts
Normal file
@ -0,0 +1,34 @@
|
||||
import { expect } from "chai";
|
||||
import { ImportedXmlComponent } from "./";
|
||||
|
||||
describe("ImportedXmlComponent", () => {
|
||||
let importedXmlComponent: ImportedXmlComponent;
|
||||
|
||||
beforeEach(() => {
|
||||
const attributes = {
|
||||
someAttr: "1",
|
||||
otherAttr: "2",
|
||||
};
|
||||
importedXmlComponent = new ImportedXmlComponent("w:test", attributes);
|
||||
importedXmlComponent.push(new ImportedXmlComponent("w:child"));
|
||||
});
|
||||
|
||||
describe("#prepForXml()", () => {
|
||||
it("should transform for xml", () => {
|
||||
const converted = importedXmlComponent.prepForXml();
|
||||
expect(converted).to.eql({
|
||||
"w:test": [
|
||||
{
|
||||
_attr: {
|
||||
someAttr: "1",
|
||||
otherAttr: "2",
|
||||
},
|
||||
},
|
||||
{
|
||||
"w:child": [],
|
||||
},
|
||||
],
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user