Skip to content

Commit e3ec0e4

Browse files
committed
gl3d jasmine tests run on CI
1 parent 4b035d6 commit e3ec0e4

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

test/jasmine/tests/gl3d_plot_interact_test.js

+25-27
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ describe('Test gl3d plots', function() {
218218
});
219219
})
220220
.then(_hover)
221-
.then(delay(20))
222221
.then(function() {
223222
assertHoverLabelContent(
224223
{
@@ -231,11 +230,12 @@ describe('Test gl3d plots', function() {
231230
.then(done);
232231
});
233232

234-
it('@noCI @gl should display correct hover labels and emit correct event data (scatter3d case)', function(done) {
233+
it('@gl should display correct hover labels and emit correct event data (scatter3d case)', function(done) {
235234
var _mock = Lib.extendDeep({}, mock2);
236235

237236
function _hover() {
238-
mouseEvent('mouseover', 605, 271);
237+
mouseEvent('mouseover', 0, 0)
238+
mouseEvent('mouseover', 655, 221);
239239
return delay(20)();
240240
}
241241

@@ -247,14 +247,13 @@ describe('Test gl3d plots', function() {
247247
});
248248
})
249249
.then(_hover)
250-
.then(delay(20))
251250
.then(function() {
252-
assertHoverText('x: 134.03', 'y: −163.59', 'z: −163.59');
253-
assertEventData(134.03, -163.59, -163.59, 0, 3, {
254-
'marker.symbol': undefined,
255-
'marker.size': 40,
256-
'marker.color': 'black',
257-
'marker.line.color': undefined
251+
assertHoverText('x: 100.75', 'y: −102.63', 'z: −102.63');
252+
assertEventData(100.75, -102.63, -102.63, 0, 0, {
253+
'marker.symbol': 'circle',
254+
'marker.size': 10,
255+
'marker.color': 'blue',
256+
'marker.line.color': 'black'
258257
});
259258
assertHoverLabelStyle(d3.selectAll('g.hovertext'), {
260259
bgcolor: 'rgb(0, 0, 255)',
@@ -270,15 +269,15 @@ describe('Test gl3d plots', function() {
270269
})
271270
.then(_hover)
272271
.then(function() {
273-
assertHoverText('x: Feb 1, 2017', 'y: −163.59', 'z: −163.59');
272+
assertHoverText('x: Jan 11, 2016', 'y: −102.63', 'z: −102.63');
274273

275274
return Plotly.restyle(gd, {
276275
x: [[new Date(2017, 2, 1), new Date(2017, 2, 2), new Date(2017, 2, 3), new Date(2017, 2, 4)]]
277276
});
278277
})
279278
.then(_hover)
280279
.then(function() {
281-
assertHoverText('x: Mar 4, 2017', 'y: −163.59', 'z: −163.59');
280+
assertHoverText('x: Mar 1, 2017', 'y: −102.63', 'z: −102.63');
282281

283282
return Plotly.update(gd, {
284283
y: [['a', 'b', 'c', 'd']],
@@ -289,25 +288,25 @@ describe('Test gl3d plots', function() {
289288
})
290289
.then(_hover)
291290
.then(function() {
292-
assertHoverText('x: Mar 4, 2017', 'y: d', 'z: 10B');
291+
assertHoverText('x: Mar 1, 2017', 'y: a', 'z: 10');
293292

294293
return Plotly.relayout(gd, 'scene.xaxis.calendar', 'chinese');
295294
})
296295
.then(_hover)
297296
.then(function() {
298-
assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B');
297+
assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10');
299298

300299
return Plotly.restyle(gd, 'text', [['A', 'B', 'C', 'D']]);
301300
})
302301
.then(_hover)
303302
.then(function() {
304-
assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'D');
303+
assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'A');
305304

306305
return Plotly.restyle(gd, 'hovertext', [['Apple', 'Banana', 'Clementine', 'Dragon fruit']]);
307306
})
308307
.then(_hover)
309308
.then(function() {
310-
assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'Dragon fruit');
309+
assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'Apple');
311310

312311
return Plotly.restyle(gd, {
313312
'hoverlabel.bgcolor': [['red', 'blue', 'green', 'yellow']],
@@ -317,11 +316,11 @@ describe('Test gl3d plots', function() {
317316
.then(_hover)
318317
.then(function() {
319318
assertHoverLabelStyle(d3.selectAll('g.hovertext'), {
320-
bgcolor: 'rgb(255, 255, 0)',
321-
bordercolor: 'rgb(68, 68, 68)',
319+
bgcolor: 'rgb(255, 0, 0)',
320+
bordercolor: 'rgb(255, 255, 255)',
322321
fontSize: 20,
323322
fontFamily: 'Arial',
324-
fontColor: 'rgb(68, 68, 68)'
323+
fontColor: 'rgb(255, 255, 255)'
325324
}, 'restyled');
326325

327326
return Plotly.relayout(gd, {
@@ -333,7 +332,7 @@ describe('Test gl3d plots', function() {
333332
.then(_hover)
334333
.then(function() {
335334
assertHoverLabelStyle(d3.selectAll('g.hovertext'), {
336-
bgcolor: 'rgb(255, 255, 0)',
335+
bgcolor: 'rgb(255, 0, 0)',
337336
bordercolor: 'rgb(255, 255, 0)',
338337
fontSize: 20,
339338
fontFamily: 'Roboto',
@@ -347,18 +346,18 @@ describe('Test gl3d plots', function() {
347346
var label = d3.selectAll('g.hovertext');
348347

349348
expect(label.size()).toEqual(1);
350-
expect(label.select('text').text()).toEqual('x: 二 7, 2017y: dz: 10BDragon fruit');
349+
expect(label.select('text').text()).toEqual('x: 二 4, 2017y: az: 10Apple');
351350

352351
return Plotly.restyle(gd, 'hoverinfo', [[null, null, 'dont+know', null]]);
353352
})
354353
.then(_hover)
355354
.then(function() {
356-
assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'Dragon fruit');
355+
assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'Apple');
357356

358357
return Plotly.restyle(gd, 'hoverinfo', 'text');
359358
})
360359
.then(function() {
361-
assertHoverText(null, null, null, 'Dragon fruit');
360+
assertHoverText(null, null, null, 'Apple');
362361

363362
return Plotly.restyle(gd, 'hovertext', 'HEY');
364363
})
@@ -368,18 +367,18 @@ describe('Test gl3d plots', function() {
368367
return Plotly.restyle(gd, 'hoverinfo', 'z');
369368
})
370369
.then(function() {
371-
assertHoverText(null, null, '10B');
370+
assertHoverText(null, null, '10');
372371

373372
return Plotly.restyle(gd, 'hovertemplate', 'THIS Y -- %{y}<extra></extra>');
374373
})
375374
.then(function() {
376-
assertHoverText(null, null, null, 'THIS Y -- d');
375+
assertHoverText(null, null, null, 'THIS Y -- a');
377376
})
378377
.catch(failTest)
379378
.then(done);
380379
});
381380

382-
it('@noCI @gl should display correct hover labels and emit correct event data (surface case)', function(done) {
381+
it('@gl should display correct hover labels and emit correct event data (surface case)', function(done) {
383382
var _mock = Lib.extendDeep({}, mock3);
384383

385384
function _hover() {
@@ -395,7 +394,6 @@ describe('Test gl3d plots', function() {
395394
});
396395
})
397396
.then(_hover)
398-
.then(delay(20))
399397
.then(function() {
400398
assertHoverText('x: 1', 'y: 2', 'z: 43', 'one two');
401399
assertEventData(1, 2, 43, 0, [1, 2]);

0 commit comments

Comments
 (0)