From 74118f20abb76972854f2723d0beea52f8c7f677 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 12 Apr 2020 14:51:59 +0100 Subject: Read font size for runs --- test/docx/body-reader.tests.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'test') diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index d6f7199..73c8647 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -565,6 +565,21 @@ test("run has font read from properties", function() { assert.deepEqual(run.font, "Arial"); }); +test("run has null fontSize by default", function() { + var runXml = runWithProperties([]); + + var run = readXmlElementValue(runXml); + assert.deepEqual(run.fontSize, null); +}); + +test("run has fontSize read from properties", function() { + var fontSizeXml = new XmlElement("w:sz", {"w:val": "28"}); + var runXml = runWithProperties([fontSizeXml]); + + var run = readXmlElementValue(runXml); + assert.deepEqual(run.fontSize, 14); +}); + test("run properties not included as child of run", function() { var runStyleXml = new XmlElement("w:rStyle"); var runPropertiesXml = new XmlElement("w:rPr", {}, [runStyleXml]); -- cgit v1.2.3