diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-09-02 23:14:17 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-09-02 23:14:17 +0100 |
| commit | 6e9740534d364c35b82428cf9f1c2bef970d0f28 (patch) | |
| tree | cda01d5a84846ef2d8b05a24d182662d0e503d0e | |
| parent | b54cb3ddfaf6e4e376db599165a0a00d4f021c83 (diff) | |
Remove redundant assertions
| -rw-r--r-- | test/docx/body-reader.tests.js | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/test/docx/body-reader.tests.js b/test/docx/body-reader.tests.js index de9a6f9..21ed961 100644 --- a/test/docx/body-reader.tests.js +++ b/test/docx/body-reader.tests.js @@ -414,12 +414,17 @@ function isSuccess(valueMatcher) { } function isImage(options) { - return allOf( - hasProperties(_.extend({type: "image"}, _.omit(options, "buffer"))), - new FeatureMatcher(willBe(options.buffer), "buffer", "buffer", function(element) { - return element.read(); - }) - ); + var matcher = hasProperties(_.extend({type: "image"}, _.omit(options, "buffer"))); + if (options.buffer) { + return allOf( + matcher, + new FeatureMatcher(willBe(options.buffer), "buffer", "buffer", function(element) { + return element.read(); + }) + ); + } else { + return matcher; + } } function readEmbeddedImage(element) { @@ -474,9 +479,7 @@ test("alt text title is used if alt text description is blank", function() { var result = readEmbeddedImage(drawing); return promiseThat(result, isSuccess(contains(isImage({ - altText: "It's a hat", - contentType: "image/png", - buffer: IMAGE_BUFFER + altText: "It's a hat" })))); }); @@ -490,9 +493,7 @@ test("alt text description is preferred to alt text title", function() { var result = readEmbeddedImage(drawing); return promiseThat(result, isSuccess(contains(isImage({ - altText: "It's a hat", - contentType: "image/png", - buffer: IMAGE_BUFFER + altText: "It's a hat" })))); }); |
