diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-04-22 13:41:52 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-04-22 13:41:52 +0100 |
| commit | 86d2aaed235cd354884d7e71ec4543f4c97e2c8b (patch) | |
| tree | 02eb94567b79a9736bc69c2749362045892b667c /tests | |
| parent | ec837dc5c639efa92fb676dc90c008ad7cfff58e (diff) | |
Always create paragraph matcher with options object
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/document-matchers.tests.js | 14 | ||||
| -rw-r--r-- | tests/style-reader.tests.js | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/tests/document-matchers.tests.js b/tests/document-matchers.tests.js index 581746c..070e0bf 100644 --- a/tests/document-matchers.tests.js +++ b/tests/document-matchers.tests.js @@ -6,17 +6,17 @@ var documents = require("../lib/documents"); var Paragraph = documents.Paragraph; describe("document-matchers", function() { - test("paragraph with no style name matches any paragraph", function() { + test("paragraph with no options matches any paragraph", function() { var matcher = documentMatchers.paragraph(); assert.ok(matcher.matches(new Paragraph())); - assert.ok(matcher.matches(paragraphWithStyle("Heading1"))); + assert.ok(matcher.matches(paragraphWithStyleId("Heading1"))); }); - test("paragraph style name only matches paragraphs with that style", function() { - var matcher = documentMatchers.paragraph("Heading1"); + test("paragraph style ID only matches paragraphs with that style ID", function() { + var matcher = documentMatchers.paragraph({styleId: "Heading1"}); assert.ok(!matcher.matches(new Paragraph())); - assert.ok(matcher.matches(paragraphWithStyle("Heading1"))); - assert.ok(!matcher.matches(paragraphWithStyle("Heading2"))); + assert.ok(matcher.matches(paragraphWithStyleId("Heading1"))); + assert.ok(!matcher.matches(paragraphWithStyleId("Heading2"))); }); test("ordered-list(index) matches an ordered list with specified level index", function() { @@ -40,6 +40,6 @@ describe("document-matchers", function() { }); }); -function paragraphWithStyle(styleId) { +function paragraphWithStyleId(styleId) { return new Paragraph([], {styleId: styleId}); } diff --git a/tests/style-reader.tests.js b/tests/style-reader.tests.js index 7fff059..50986e5 100644 --- a/tests/style-reader.tests.js +++ b/tests/style-reader.tests.js @@ -58,7 +58,7 @@ describe("styleReader.readDocumentMatcher", function() { test("reads paragraph with style ID", function() { assert.deepEqual( readDocumentMatcher("p.Heading1"), - documentMatchers.paragraph("Heading1") + documentMatchers.paragraph({styleId: "Heading1"}) ); }); |
