From 86d2aaed235cd354884d7e71ec4543f4c97e2c8b Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 22 Apr 2014 13:41:52 +0100 Subject: Always create paragraph matcher with options object --- tests/document-matchers.tests.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'tests/document-matchers.tests.js') 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}); } -- cgit v1.2.3