diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-19 12:03:32 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-19 12:03:32 +0000 |
| commit | 6bef85a8fde03b50de4aa78064ab4c32ad54041c (patch) | |
| tree | 84bc1ab1c337f0ca045b1cb34487ec07f4c84c76 /test/styles | |
| parent | 68d8c8140fb6ef1118fa2815243817f8e4f55b59 (diff) | |
Introduce matcher for style name
Diffstat (limited to 'test/styles')
| -rw-r--r-- | test/styles/document-matchers.tests.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/styles/document-matchers.tests.js b/test/styles/document-matchers.tests.js index e36298c..9f2864b 100644 --- a/test/styles/document-matchers.tests.js +++ b/test/styles/document-matchers.tests.js @@ -19,12 +19,19 @@ test("paragraph style ID only matches paragraphs with that style ID", function() }); test("paragraph style name only matches paragraphs with that style name", function() { - var matcher = documentMatchers.paragraph({styleName: "Heading 1"}); + var matcher = documentMatchers.paragraph({styleName: documentMatchers.equalTo("Heading 1")}); assert.ok(!matcher.matches(new Paragraph())); assert.ok(matcher.matches(paragraphWithStyle("Heading1", "Heading 1"))); assert.ok(!matcher.matches(paragraphWithStyle("Heading2", "Heading 2"))); }); +test("paragraph style name matching is case insensitive", function() { + var matcher = documentMatchers.paragraph({styleName: documentMatchers.equalTo("heading 1")}); + assert.ok(!matcher.matches(new Paragraph())); + assert.ok(matcher.matches(paragraphWithStyle("Heading1", "heaDING 1"))); + assert.ok(!matcher.matches(paragraphWithStyle("Heading2", "heaDING 2"))); +}); + test("ordered-list(index) matches an ordered list with specified level index", function() { var matcher = documentMatchers.paragraph({list: {isOrdered: true, levelIndex: 1}}); assert.ok(!matcher.matches(new Paragraph())); |
