Skip to content

Commit

Permalink
use pseudo-random number in scattergl large color arrays test
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Feb 21, 2018
1 parent 20c3a00 commit eae6da2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/jasmine/tests/gl2d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ var selectButton = require('../assets/modebar_button');
var delay = require('../assets/delay');
var readPixel = require('../assets/read_pixel');


function countCanvases() {
return d3.selectAll('canvas').size();
}
Expand Down Expand Up @@ -797,9 +796,11 @@ describe('@gl Test gl2d plots', function() {
var w = 500;
var h = 500;

Lib.seedPseudoRandom();

for(var i = 0; i < N; i++) {
x.push(i);
color.push(Math.random());
color.push(Lib.pseudoRandom());
}

Plotly.newPlot(gd, [{
Expand All @@ -824,8 +825,9 @@ describe('@gl Test gl2d plots', function() {
var total = readPixel(gd.querySelector('.gl-canvas-context'), 0, 0, w, h)
.reduce(function(acc, v) { return acc + v; }, 0);

// the total value was 3762487 before PR
// the total value was 3777134 before PR
// https://github.com/plotly/plotly.js/pull/2377
// and 105545275 after.
expect(total).toBeGreaterThan(4e6);
})
.catch(fail)
Expand Down

0 comments on commit eae6da2

Please sign in to comment.