aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorvgmoose <me@vgmoose.com>2017-07-19 16:26:35 -0400
committervgmoose <me@vgmoose.com>2017-07-19 17:24:11 -0400
commit9c9cb3e30d7cae37b42537e59ba38571a9e06097 (patch)
treeaa9cc3096cdf484fcffba4a9513283cf00894ddb /test
parent534f62e0684af52766adf82b8fd5dbf796e018db (diff)
Parse small caps style mappings (see #123)
Diffstat (limited to 'test')
-rw-r--r--test/docx/body-reader.tests.js14
-rw-r--r--test/style-reader.tests.js8
2 files changed, 22 insertions, 0 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js
index 5257530..f84f0e8 100644
--- a/test/docx/body-reader.tests.js
+++ b/test/docx/body-reader.tests.js
@@ -431,11 +431,25 @@ test("isItalic is true if bold element is present", function() {
assert.equal(run.isItalic, true);
});
+test("isSmallCaps is false if smallcaps element is not present", function() {
+ var runXml = runWithProperties([]);
+ var run = readXmlElementValue(runXml);
+ assert.deepEqual(run.isSmallCaps, false);
+});
+
+test("isSmallCaps is true if smallcaps element is present", function() {
+ var smallCapsXml = new XmlElement("w:smallCaps");
+ var runXml = runWithProperties([smallCapsXml]);
+ var run = readXmlElementValue(runXml);
+ assert.equal(run.isSmallCaps, true);
+});
+
var booleanRunProperties = [
{name: "isBold", tagName: "w:b"},
{name: "isUnderline", tagName: "w:u"},
{name: "isItalic", tagName: "w:i"},
{name: "isStrikethrough", tagName: "w:strike"},
+ {name: "isSmallCaps", tagName: "w:smallCaps"},
];
booleanRunProperties.forEach(function(runProperty) {
diff --git a/test/style-reader.tests.js b/test/style-reader.tests.js
index 96c0c39..2ae7385 100644
--- a/test/style-reader.tests.js
+++ b/test/style-reader.tests.js
@@ -185,7 +185,15 @@ test("styleReader.readDocumentMatcher", {
"br[type='column']",
documentMatchers.columnBreak
);
+ },
+
+ "reads smallcaps": function() {
+ assertDocumentMatcher(
+ "smallCaps",
+ documentMatchers.smallCaps
+ );
}
+
});
function assertDocumentMatcher(input, expected) {