Rename methods

This commit is contained in:
Dolan
2019-01-11 01:45:57 +00:00
parent 3f652764e9
commit d19cdcae0c
2 changed files with 8 additions and 8 deletions

View File

@ -52,7 +52,7 @@ describe("External styles factory", () => {
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any; const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
expect(importedStyle.rootKey).to.equal("w:styles"); expect(importedStyle.rootKey).to.equal("w:styles");
expect(importedStyle.root[0]._attr).to.eql({ expect(importedStyle.root[0]._attr).to.deep.equal({
"xmlns:mc": "first", "xmlns:mc": "first",
"xmlns:r": "second", "xmlns:r": "second",
}); });
@ -61,7 +61,7 @@ describe("External styles factory", () => {
it("should parse other child elements of w:styles", () => { it("should parse other child elements of w:styles", () => {
// tslint:disable-next-line:no-any // tslint:disable-next-line:no-any
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any; const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
expect(importedStyle.root[1]).to.eql({ expect(importedStyle.root[1]).to.deep.equal({
deleted: false, deleted: false,
root: [ root: [
{ {
@ -122,7 +122,7 @@ describe("External styles factory", () => {
], ],
rootKey: "w:docDefaults", rootKey: "w:docDefaults",
}); });
expect(importedStyle.root[2]).to.eql({ expect(importedStyle.root[2]).to.deep.equal({
_attr: { _attr: {
"w:defLockedState": "1", "w:defLockedState": "1",
"w:defUIPriority": "99", "w:defUIPriority": "99",
@ -138,7 +138,7 @@ describe("External styles factory", () => {
const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any; const importedStyle = new ExternalStylesFactory().newInstance(externalStyles) as any;
expect(importedStyle.root.length).to.equal(5); expect(importedStyle.root.length).to.equal(5);
expect(importedStyle.root[3]).to.eql({ expect(importedStyle.root[3]).to.deep.equal({
_attr: { _attr: {
"w:default": "1", "w:default": "1",
"w:styleId": "Normal", "w:styleId": "Normal",
@ -163,7 +163,7 @@ describe("External styles factory", () => {
rootKey: "w:style", rootKey: "w:style",
}); });
expect(importedStyle.root[4]).to.eql({ expect(importedStyle.root[4]).to.deep.equal({
_attr: { _attr: {
"w:styleId": "Heading1", "w:styleId": "Heading1",
"w:type": "paragraph", "w:type": "paragraph",

View File

@ -50,7 +50,7 @@ describe("ImportedXmlComponent", () => {
describe("#prepForXml()", () => { describe("#prepForXml()", () => {
it("should transform for xml", () => { it("should transform for xml", () => {
const converted = importedXmlComponent.prepForXml(); const converted = importedXmlComponent.prepForXml();
expect(converted).to.eql({ expect(converted).to.deep.equal({
"w:test": [ "w:test": [
{ {
_attr: { _attr: {
@ -68,14 +68,14 @@ describe("ImportedXmlComponent", () => {
it("should create XmlComponent from xml string", () => { it("should create XmlComponent from xml string", () => {
const converted = ImportedXmlComponent.fromXmlString(xmlString); const converted = ImportedXmlComponent.fromXmlString(xmlString);
expect(converted).to.eql(convertedXmlElement); expect(converted).to.deep.equal(convertedXmlElement);
}); });
describe("convertToXmlComponent", () => { describe("convertToXmlComponent", () => {
it("should convert to xml component", () => { it("should convert to xml component", () => {
const xmlObj = xml2js(xmlString, { compact: false }) as Element; const xmlObj = xml2js(xmlString, { compact: false }) as Element;
const converted = convertToXmlComponent(xmlObj); const converted = convertToXmlComponent(xmlObj);
expect(converted).to.eql(convertedXmlElement); expect(converted).to.deep.equal(convertedXmlElement);
}); });
}); });
}); });