Tests: Second attempt to find fitting tolerance for failing gradient SVG export.

This commit is contained in:
Jürg Lehni 2016-04-13 14:37:13 -07:00
parent 6f4738f8b2
commit eceb133686
2 changed files with 2 additions and 2 deletions

View file

@ -204,7 +204,7 @@ var comparePixels = function(actual, expected, message, options) {
.onComplete(function(data) { result = data; }); .onComplete(function(data) { result = data; });
// Compare with tolerance in percentage... // Compare with tolerance in percentage...
var tolerance = (options.tolerance || 1e-4) * 100, var tolerance = (options.tolerance || 1e-4) * 100,
fixed = ((1 / tolerance) + '').length - 1, fixed = tolerance < 1 ? ((1 / tolerance) + '').length - 1 : 0,
identical = result ? 100 - result.misMatchPercentage : 0, identical = result ? 100 - result.misMatchPercentage : 0,
reached = identical.toFixed(fixed), reached = identical.toFixed(fixed),
hundred = (100).toFixed(fixed), hundred = (100).toFixed(fixed),

View file

@ -188,7 +188,7 @@ if (!isNode) {
var svg = project.exportSVG({ bounds: 'content', asString: true }); var svg = project.exportSVG({ bounds: 'content', asString: true });
compareSVG(assert.async(), svg, project.activeLayer, null, { compareSVG(assert.async(), svg, project.activeLayer, null, {
tolerance: 1e-1 tolerance: 1e-2
}); });
}); });
} }