Skip to content

Commit 67f372d

Browse files
committed
fixup cone tests
1 parent bb4bde7 commit 67f372d

File tree

1 file changed

+15
-26
lines changed

1 file changed

+15
-26
lines changed

test/jasmine/tests/cone_test.js

+15-26
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,14 @@ describe('@gl Test cone autorange:', function() {
8181

8282
it('should add pad around cone position to make sure they fit on the scene', function(done) {
8383
var fig = Lib.extendDeep({}, require('@mocks/gl3d_cone-autorange.json'));
84+
var rng0 = [0.103, 3.897];
8485

8586
function makeScaleFn(s) {
8687
return function(v) { return v * s; };
8788
}
8889

8990
Plotly.plot(gd, fig).then(function() {
90-
_assertAxisRanges('base',
91-
[-0.66, 4.66], [-0.66, 4.66], [-0.66, 4.66]
92-
);
91+
_assertAxisRanges('base', rng0, rng0, rng0);
9392

9493
// the resulting image should be independent of what I multiply by here
9594
var trace = fig.data[0];
@@ -101,9 +100,7 @@ describe('@gl Test cone autorange:', function() {
101100
return Plotly.restyle(gd, {u: [u], v: [v], w: [w]});
102101
})
103102
.then(function() {
104-
_assertAxisRanges('scaled up',
105-
[-0.66, 4.66], [-0.66, 4.66], [-0.66, 4.66]
106-
);
103+
_assertAxisRanges('scaled up', rng0, rng0, rng0);
107104

108105
// the resulting image should be independent of what I multiply by here
109106
var trace = fig.data[0];
@@ -115,12 +112,9 @@ describe('@gl Test cone autorange:', function() {
115112
return Plotly.restyle(gd, {u: [u], v: [v], w: [w]});
116113
})
117114
.then(function() {
118-
_assertAxisRanges('scaled down',
119-
[-0.66, 4.66], [-0.66, 4.66], [-0.66, 4.66]
120-
);
115+
_assertAxisRanges('scaled down', rng0, rng0, rng0);
121116

122117
var trace = fig.data[0];
123-
124118
var x = trace.x.slice();
125119
x.push(5);
126120
var y = trace.y.slice();
@@ -140,33 +134,29 @@ describe('@gl Test cone autorange:', function() {
140134
});
141135
})
142136
.then(function() {
143-
_assertAxisRanges('after adding one cone outside range but with norm-0',
144-
[-0.72, 6.72], [-0.72, 6.72], [-0.72, 6.72]
145-
);
137+
var rng = [0.041, 5.959];
138+
_assertAxisRanges('after adding one cone outside range but with norm-0', rng, rng, rng);
146139

147140
return Plotly.restyle(gd, 'sizeref', 10);
148141
})
149142
.then(function() {
150-
_assertAxisRanges('after increasing sizeref',
151-
[-15.06, 21.06], [-15.06, 21.06], [-15.06, 21.06]
152-
);
143+
var rng = [-15.808, 21.808];
144+
_assertAxisRanges('after increasing sizeref', rng, rng, rng);
153145

154146
return Plotly.restyle(gd, 'sizeref', 0.1);
155147
})
156148
.then(function() {
157-
_assertAxisRanges('after decreasing sizeref',
158-
[0.72, 5.28], [0.72, 5.28], [0.72, 5.28]
159-
);
149+
var rng = [0.708, 5.292];
150+
_assertAxisRanges('after decreasing sizeref', rng, rng, rng);
160151

161152
return Plotly.restyle(gd, {
162153
sizemode: 'absolute',
163154
sizeref: 2
164155
});
165156
})
166157
.then(function() {
167-
_assertAxisRanges('with sizemode absolute',
168-
[0.63, 5.37], [0.63, 5.37], [0.63, 5.37]
169-
);
158+
var rng = [0.614, 5.386];
159+
_assertAxisRanges('with sizemode absolute', rng, rng, rng);
170160

171161
var trace = fig.data[0];
172162
var m = makeScaleFn(2);
@@ -179,9 +169,8 @@ describe('@gl Test cone autorange:', function() {
179169
});
180170
})
181171
.then(function() {
182-
_assertAxisRanges('after spacing out the x/y/z coordinates',
183-
[1.25, 10.75], [1.25, 10.75], [1.25, 10.75]
184-
);
172+
var rng = [1.229, 10.771];
173+
_assertAxisRanges('after spacing out the x/y/z coordinates', rng, rng, rng);
185174
})
186175
.catch(failTest)
187176
.then(done);
@@ -268,7 +257,7 @@ describe('@gl Test cone interactions', function() {
268257

269258
it('should display hover labels (multi-trace case)', function(done) {
270259
function _hover() {
271-
mouseEvent('mouseover', 245, 230);
260+
mouseEvent('mouseover', 282, 240);
272261
return delay(20)();
273262
}
274263

0 commit comments

Comments
 (0)