diff --git a/Changelog.md b/Changelog.md index fd34a6a14..c67719b4f 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,4 +1,7 @@ # 2.0 Series +## 2.0.0 beta 14 +* Fix a test for IE and add svg subpath matcher, for #894 + ## 2.0.0 beta 13 * Pie chart radius padding, by Matt Traynham ([#894](https://github.com/dc-js/dc.js/pull/894)) * Example of a table showing group-aggregated data, by Ion Alberdi ([#929](https://github.com/dc-js/dc.js/pull/929)) diff --git a/spec/helpers/custom_matchers.js b/spec/helpers/custom_matchers.js index 3adf6f11f..91d5e7d72 100644 --- a/spec/helpers/custom_matchers.js +++ b/spec/helpers/custom_matchers.js @@ -59,42 +59,61 @@ function compareWithinDelta(actual, expected, delta){ return result; } -// note: to make this reusable as a boolean predicate, it only returns the first +// note: to make these reusable as boolean predicates, they only returns the first // failure instead of using expect -function comparePaths(actual, expected, delta) { - delta = delta || 1; // default delta of 1px - var got = parsePath(actual), - wanted = parsePath(expected); - if(got.length != wanted.length) - return { - pass: false, - message: "actual number of path cmds " + actual.length + - " did not match expected number " + expected.length - }; - for(var i = 0; i!=got.length; ++i) { - var command_num = "path command #" + i; - if(got[i].op.toUpperCase() != wanted[i].op.toUpperCase()) + +function compareSubPath(got, wanted, i, j, delta) { + for(var k = 0; k!=wanted.length; ++k) { + var command_num = "path command #" + i+k; + if(got[i+k].op.toUpperCase() != wanted[j+k].op.toUpperCase()) return { pass: false, - message: command_num + " actual '" + got[i].op.toUpperCase() + - "' != expected '" + wanted[i].op.toUpperCase() + "'" + message: command_num + " actual '" + got[i+k].op.toUpperCase() + + "' != expected '" + wanted[j+k].op.toUpperCase() + "'" }; - if(got[i].args.length != wanted[i].args.length) + if(got[i+k].args.length != wanted[j+k].args.length) return { pass: false, message: command_num + " number of arguments " + - got[i].args.length + " != expected " + wanted[i].args.length + got[i+k].args.length + " != expected " + wanted[j+k].args.length }; - for(var j = 0; j