diff options
| author | Michael Williamson <mike@zwobble.org> | 2020-04-12 14:51:59 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2020-04-12 14:51:59 +0100 |
| commit | 74118f20abb76972854f2723d0beea52f8c7f677 (patch) | |
| tree | 39ddd471da5bff7ec6e576ee57b40d083565940c /test | |
| parent | dd8b8291facb24be3e73ab17be56d43f33f40780 (diff) | |
Read font size for runs
Diffstat (limited to 'test')
| -rw-r--r-- | test/docx/body-reader.tests.js | 15 |
1 files changed, 15 insertions, 0 deletions
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]); |
