Skip to content

Commit

Permalink
Make test more consistent with other implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Feb 18, 2024
1 parent 0459e2c commit 149bf2b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/docx/document-xml-reader.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ test("when body element is present then body is read", function() {
var documentXmlReader = new DocumentXmlReader({
bodyReader: bodyReader
});
var paragraphXml = xml.element("w:p", {}, []);
var textXml = xml.element("w:t", {}, [xml.text("Hello!")]);
var runXml = xml.element("w:r", {}, [textXml]);
var paragraphXml = xml.element("w:p", {}, [runXml]);
var bodyXml = xml.element("w:body", {}, [paragraphXml]);
var documentXml = xml.element("w:document", {}, [bodyXml]);

var result = documentXmlReader.convertXmlToDocument(documentXml);

assert.deepEqual(result.messages, []);
assert.deepEqual(result.value, documents.document(
[documents.paragraph([])],
[documents.paragraph([documents.run([documents.text("Hello!")])])],
{}
));
});
Expand Down

0 comments on commit 149bf2b

Please sign in to comment.