Skip to content

Commit 39be256

Browse files
committed
Avoid randomity in test
1 parent 8692ec9 commit 39be256

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/jasmine/tests/gl_plot_interact_test.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1612,12 +1612,12 @@ describe('Test gl2d plots', function() {
16121612
.then(done);
16131613
});
16141614

1615-
it('should display selection of big number of points', function(done) {
1615+
fit('should display selection of big number of points', function(done) {
16161616
// generate large number of points
1617-
var x = [], y = [];
1618-
for(var i = 0; i < 2e4; i++) {
1619-
x.push(Math.random());
1620-
y.push(Math.random());
1617+
var x = [], y = [], n = 2e2, N = n * n;
1618+
for(var i = 0; i < N; i++) {
1619+
x.push((i % n) / n);
1620+
y.push(i / N);
16211621
}
16221622

16231623
var mock = {
@@ -1630,7 +1630,9 @@ describe('Test gl2d plots', function() {
16301630
};
16311631

16321632
Plotly.plot(gd, mock)
1633+
.then(delay(1000))
16331634
.then(select([[160, 100], [180, 100]]))
1635+
.then(delay(1000))
16341636
.then(function() {
16351637
expect(readPixel(gd.querySelector('.gl-canvas-context'), 168, 100)[3]).toBe(0);
16361638
expect(readPixel(gd.querySelector('.gl-canvas-context'), 158, 100)[3]).not.toBe(0);

0 commit comments

Comments
 (0)