diff --git a/src/file/document/body/section-properties/section-properties.spec.ts b/src/file/document/body/section-properties/section-properties.spec.ts index 189510e28e..994db13891 100644 --- a/src/file/document/body/section-properties/section-properties.spec.ts +++ b/src/file/document/body/section-properties/section-properties.spec.ts @@ -22,7 +22,7 @@ describe("SectionProperties", () => { const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); expect(tree["w:sectPr"]).to.be.an.instanceof(Array); - expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906 } }] }); + expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906, "w:orient": "portrait" } }] }); expect(tree["w:sectPr"][1]).to.deep.equal({ "w:pgMar": [ { @@ -45,7 +45,7 @@ describe("SectionProperties", () => { const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); expect(tree["w:sectPr"]).to.be.an.instanceof(Array); - expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906 } }] }); + expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906, "w:orient": "portrait" } }] }); expect(tree["w:sectPr"][1]).to.deep.equal({ "w:pgMar": [ { @@ -70,7 +70,7 @@ describe("SectionProperties", () => { const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); expect(tree["w:sectPr"]).to.be.an.instanceof(Array); - expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906 } }] }); + expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906, "w:orient": "portrait" } }] }); expect(tree["w:sectPr"][1]).to.deep.equal({ "w:pgMar": [ { @@ -95,7 +95,7 @@ describe("SectionProperties", () => { const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); expect(tree["w:sectPr"]).to.be.an.instanceof(Array); - expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906 } }] }); + expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 16838, "w:w": 11906, "w:orient": "portrait" } }] }); expect(tree["w:sectPr"][1]).to.deep.equal({ "w:pgMar": [ { @@ -121,7 +121,7 @@ describe("SectionProperties", () => { const tree = new Formatter().format(properties); expect(Object.keys(tree)).to.deep.equal(["w:sectPr"]); expect(tree["w:sectPr"]).to.be.an.instanceof(Array); - expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 0, "w:w": 0 } }] }); + expect(tree["w:sectPr"][0]).to.deep.equal({ "w:pgSz": [{ _attr: { "w:h": 0, "w:w": 0, "w:orient": "portrait" } }] }); expect(tree["w:sectPr"][1]).to.deep.equal({ "w:pgMar": [ { diff --git a/src/file/document/document.spec.ts b/src/file/document/document.spec.ts index 150df18ad2..a3981febaa 100644 --- a/src/file/document/document.spec.ts +++ b/src/file/document/document.spec.ts @@ -32,7 +32,7 @@ describe("Document", () => { expect(body) .to.be.an("array") .which.has.length.at.least(1); - expect(body[0]).to.have.property("w:p"); + expect(body[1]).to.have.property("w:p"); }); it("should use the text given to create a run in the paragraph", () => { @@ -42,7 +42,7 @@ describe("Document", () => { expect(body) .to.be.an("array") .which.has.length.at.least(1); - expect(body[0]) + expect(body[1]) .to.have.property("w:p") .which.includes({ "w:r": [{ "w:rPr": [] }, { "w:t": [{ _attr: { "xml:space": "preserve" } }, "sample paragraph text"] }], @@ -58,7 +58,7 @@ describe("Document", () => { expect(body) .to.be.an("array") .which.has.length.at.least(1); - expect(body[0]).to.have.property("w:tbl"); + expect(body[1]).to.have.property("w:tbl"); }); it("should create a table with the correct dimensions", () => { @@ -67,7 +67,7 @@ describe("Document", () => { expect(body) .to.be.an("array") .which.has.length.at.least(1); - expect(body[0]) + expect(body[1]) .to.have.property("w:tbl") .which.includes({ "w:tblGrid": [ @@ -76,7 +76,7 @@ describe("Document", () => { { "w:gridCol": [{ _attr: { "w:w": 1 } }] }, ], }); - expect(body[0]["w:tbl"].filter((x) => x["w:tr"])).to.have.length(2); + expect(body[1]["w:tbl"].filter((x) => x["w:tr"])).to.have.length(2); }); }); });