Skip to content

Commit 174ec01

Browse files
committed
update jasmine tests
1 parent 5cfe400 commit 174ec01

File tree

12 files changed

+61
-71
lines changed

12 files changed

+61
-71
lines changed

test/jasmine/bundle_tests/mathjax_test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('Test MathJax v' + mathjaxVersion + ':', function() {
8484
y: [1, 2, 1]
8585
}],
8686
layout: {
87-
xaxis: {title: 'TITLE'},
87+
xaxis: { title: { text: 'TITLE' } },
8888
width: 500,
8989
height: 500,
9090
margin: {t: 100, b: 100, l: 100, r: 100}
@@ -125,7 +125,7 @@ describe('Test MathJax v' + mathjaxVersion + ':', function() {
125125
y: [1, 2, 1]
126126
}],
127127
layout: {
128-
xaxis: {title: 'TITLE'},
128+
xaxis: { title: { text: 'TITLE' } },
129129
width: 500,
130130
height: 500,
131131
margin: {t: 100, b: 100, l: 100, r: 100}
@@ -145,7 +145,7 @@ describe('Test MathJax v' + mathjaxVersion + ':', function() {
145145
y: [1, 2, 1]
146146
}],
147147
layout: {
148-
xaxis: {title: texTitle},
148+
xaxis: { title: { text: texTitle } },
149149
width: 500,
150150
height: 500,
151151
margin: {t: 100, b: 100, l: 100, r: 100}

test/jasmine/tests/cartesian_test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ describe('subplot creation / deletion:', function() {
392392
}
393393

394394
Plotly.newPlot(gd, [], {
395-
xaxis: { title: 'X' },
396-
yaxis: { title: 'Y' },
397-
xaxis2: { title: 'X2', anchor: 'y2' },
398-
yaxis2: { title: 'Y2', anchor: 'x2' }
395+
xaxis: { title: { text: 'X' } },
396+
yaxis: { title: { text: 'Y' } },
397+
xaxis2: { title: { text: 'X2' }, anchor: 'y2' },
398+
yaxis2: { title: { text: 'Y2' }, anchor: 'x2' }
399399
})
400400
.then(function() {
401401
assertOrphanSubplot(1);
@@ -415,7 +415,7 @@ describe('subplot creation / deletion:', function() {
415415
it('should remove unused axes when deleting traces', function(done) {
416416
Plotly.newPlot(gd,
417417
[{y: [1, 2, 3]}, {y: [10, 30, 20], yaxis: 'y2'}],
418-
{yaxis2: {side: 'right', overlaying: 'y', title: 'Hi!'}}
418+
{ yaxis2: { side: 'right', overlaying: 'y', title: { text: 'Hi!' } }}
419419
)
420420
.then(function() {
421421
expect(gd.querySelectorAll('.xy2,.xy2-x,.xy2-y').length).not.toBe(0);
@@ -805,8 +805,8 @@ describe('subplot creation / deletion:', function() {
805805
Plotly.newPlot(gd, [{
806806
y: [1, 2, 1]
807807
}], {
808-
xaxis: {title: 'X'},
809-
yaxis: {title: 'Y'}
808+
xaxis: { title: { text: 'X' } },
809+
yaxis: { title: { text: 'Y' } }
810810
})
811811
.then(function() {
812812
_assert([5, 4, 1], [6, 6, 1]);

test/jasmine/tests/click_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,15 +931,15 @@ describe('Test click interactions:', function() {
931931
}],
932932
layout: {
933933
xaxis: {
934-
title: 'xaxis',
934+
title: {text: 'xaxis'},
935935
range: [0, 4]
936936
},
937937
yaxis: {
938938
titel: 'yaxis',
939939
range: [-1, 5]
940940
},
941941
yaxis2: {
942-
title: 'yaxis2',
942+
title: { text: 'yaxis2' },
943943
overlaying: 'y',
944944
side: 'right',
945945
showgrid: false,

test/jasmine/tests/funnelarea_test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ describe('Funnelarea traces', function() {
301301
it('shows title top center if titleposition is undefined', function(done) {
302302
Plotly.newPlot(gd, [{
303303
values: [2, 2, 2, 2],
304-
title: 'Test<BR>Title',
304+
title: { text: 'Test<BR>Title' },
305305
titlefont: {
306306
size: 12
307307
},
@@ -315,7 +315,7 @@ describe('Funnelarea traces', function() {
315315
it('shows title top center', function(done) {
316316
Plotly.newPlot(gd, [{
317317
values: [1, 1, 1, 1, 2],
318-
title: 'Test<BR>Title',
318+
title: { text: 'Test<BR>Title' },
319319
titleposition: 'top center',
320320
titlefont: {
321321
size: 12
@@ -330,7 +330,7 @@ describe('Funnelarea traces', function() {
330330
it('shows title top left', function(done) {
331331
Plotly.newPlot(gd, [{
332332
values: [3, 2, 1],
333-
title: 'Test<BR>Title',
333+
title: { text: 'Test<BR>Title' },
334334
titleposition: 'top left',
335335
titlefont: {
336336
size: 12
@@ -345,7 +345,7 @@ describe('Funnelarea traces', function() {
345345
it('shows title top right', function(done) {
346346
Plotly.newPlot(gd, [{
347347
values: [4, 5, 6, 5],
348-
title: 'Test<BR>Title',
348+
title: { text: 'Test<BR>Title' },
349349
titleposition: 'top right',
350350
titlefont: {
351351
size: 12
@@ -360,7 +360,7 @@ describe('Funnelarea traces', function() {
360360
it('correctly positions large title', function(done) {
361361
Plotly.newPlot(gd, [{
362362
values: [1, 3, 4, 1, 2],
363-
title: 'Test<BR>Title',
363+
title: { text: 'Test<BR>Title' },
364364
titleposition: 'top center',
365365
titlefont: {
366366
size: 60
@@ -591,7 +591,7 @@ describe('Funnelarea traces', function() {
591591
Plotly.newPlot(gd, [{
592592
type: 'funnelarea',
593593
values: [1, 2, 3],
594-
title: 'yo',
594+
title: { text: 'yo' },
595595
titlefont: {color: 'blue'},
596596
titleposition: 'top left'
597597
}])
@@ -600,7 +600,7 @@ describe('Funnelarea traces', function() {
600600
_verifyTitle(true, false, true, false, false);
601601

602602
return Plotly.restyle(gd, {
603-
title: 'oy',
603+
title: { text: 'oy' },
604604
'titlefont.color': 'red',
605605
titleposition: 'top right'
606606
});

test/jasmine/tests/pie_test.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ describe('Pie traces', function() {
305305
it('shows multiline title in hole', function(done) {
306306
Plotly.newPlot(gd, [{
307307
values: [2, 2, 2, 2],
308-
title: 'Test<br>Title',
308+
title: { text: 'Test<BR>Title' },
309309
hole: 0.5,
310310
type: 'pie',
311311
textinfo: 'none'
@@ -329,7 +329,7 @@ describe('Pie traces', function() {
329329
it('scales multiline title to fit in hole', function(done) {
330330
Plotly.newPlot(gd, [{
331331
values: [2, 2, 2, 2],
332-
title: 'Test<br>Title',
332+
title: { text: 'Test<BR>Title' },
333333
titleposition: 'middle center',
334334
titlefont: {
335335
size: 60
@@ -379,7 +379,7 @@ describe('Pie traces', function() {
379379
it('shows title top center if hole is zero', function(done) {
380380
Plotly.newPlot(gd, [{
381381
values: [2, 2, 2, 2],
382-
title: 'Test<BR>Title',
382+
title: { text: 'Test<BR>Title' },
383383
titleposition: 'middle center',
384384
titlefont: {
385385
size: 12
@@ -395,7 +395,7 @@ describe('Pie traces', function() {
395395
it('shows title top center if titleposition is undefined and no hole', function(done) {
396396
Plotly.newPlot(gd, [{
397397
values: [2, 2, 2, 2],
398-
title: 'Test<BR>Title',
398+
title: { text: 'Test<BR>Title' },
399399
titlefont: {
400400
size: 12
401401
},
@@ -409,7 +409,7 @@ describe('Pie traces', function() {
409409
it('shows title top center', function(done) {
410410
Plotly.newPlot(gd, [{
411411
values: [1, 1, 1, 1, 2],
412-
title: 'Test<BR>Title',
412+
title: { text: 'Test<BR>Title' },
413413
titleposition: 'top center',
414414
titlefont: {
415415
size: 12
@@ -424,7 +424,7 @@ describe('Pie traces', function() {
424424
it('shows title top left', function(done) {
425425
Plotly.newPlot(gd, [{
426426
values: [3, 2, 1],
427-
title: 'Test<BR>Title',
427+
title: { text: 'Test<BR>Title' },
428428
titleposition: 'top left',
429429
titlefont: {
430430
size: 12
@@ -439,7 +439,7 @@ describe('Pie traces', function() {
439439
it('shows title top right', function(done) {
440440
Plotly.newPlot(gd, [{
441441
values: [4, 5, 6, 5],
442-
title: 'Test<BR>Title',
442+
title: { text: 'Test<BR>Title' },
443443
titleposition: 'top right',
444444
titlefont: {
445445
size: 12
@@ -454,7 +454,7 @@ describe('Pie traces', function() {
454454
it('shows title bottom left', function(done) {
455455
Plotly.newPlot(gd, [{
456456
values: [4, 5, 6, 5],
457-
title: 'Test<BR>Title',
457+
title: { text: 'Test<BR>Title' },
458458
titleposition: 'bottom left',
459459
titlefont: {
460460
size: 12
@@ -469,7 +469,7 @@ describe('Pie traces', function() {
469469
it('shows title bottom center', function(done) {
470470
Plotly.newPlot(gd, [{
471471
values: [4, 5, 6, 5],
472-
title: 'Test<BR>Title',
472+
title: { text: 'Test<BR>Title' },
473473
titleposition: 'bottom center',
474474
titlefont: {
475475
size: 12
@@ -484,7 +484,7 @@ describe('Pie traces', function() {
484484
it('shows title bottom right', function(done) {
485485
Plotly.newPlot(gd, [{
486486
values: [4, 5, 6, 5],
487-
title: 'Test<BR>Title',
487+
title: { text: 'Test<BR>Title' },
488488
titleposition: 'bottom right',
489489
titlefont: {
490490
size: 12
@@ -499,7 +499,7 @@ describe('Pie traces', function() {
499499
it('should be able to restyle title position', function(done) {
500500
Plotly.newPlot(gd, [{
501501
values: [3, 2, 1],
502-
title: 'Test<BR>Title',
502+
title: { text: 'Test<BR>Title' },
503503
titleposition: 'top left',
504504
titlefont: {
505505
size: 12
@@ -522,7 +522,7 @@ describe('Pie traces', function() {
522522
it('does not intersect pulled slices', function(done) {
523523
Plotly.newPlot(gd, [{
524524
values: [2, 2, 2, 2],
525-
title: 'Test<BR>Title',
525+
title: { text: 'Test<BR>Title' },
526526
titleposition: 'top center',
527527
titlefont: {
528528
size: 14
@@ -548,7 +548,7 @@ describe('Pie traces', function() {
548548
it('correctly positions large title', function(done) {
549549
Plotly.newPlot(gd, [{
550550
values: [1, 3, 4, 1, 2],
551-
title: 'Test<BR>Title',
551+
title: { text: 'Test<BR>Title' },
552552
titleposition: 'top center',
553553
titlefont: {
554554
size: 60
@@ -795,7 +795,7 @@ describe('Pie traces', function() {
795795
Plotly.newPlot(gd, [{
796796
type: 'pie',
797797
values: [1, 2, 3],
798-
title: 'yo',
798+
title: { text: 'yo' },
799799
titlefont: {color: 'blue'},
800800
titleposition: 'top left'
801801
}])
@@ -837,7 +837,7 @@ describe('Pie traces', function() {
837837
Plotly.newPlot(gd, [{
838838
type: 'pie',
839839
values: [1, 2, 3],
840-
title: 'yo',
840+
title: { text: 'yo' },
841841
titlefont: {color: 'blue'},
842842
titleposition: 'top left'
843843
}])
@@ -846,7 +846,7 @@ describe('Pie traces', function() {
846846
_verifyTitle(true, false, true, false, false);
847847

848848
return Plotly.restyle(gd, {
849-
title: 'oy',
849+
title: { text: 'oy' },
850850
'titlefont.color': 'red',
851851
titleposition: 'bottom right'
852852
});

test/jasmine/tests/plot_api_test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ describe('Test plot api', function() {
260260
x: [1, 2, 3],
261261
y: [1, 2, 1]
262262
}], {
263-
xaxis: { title: 'x title' },
264-
yaxis: { title: 'y title' }
263+
xaxis: { title: { text: 'x title' } },
264+
yaxis: { title: { text: 'y title' } }
265265
})
266266
.then(function() {
267267
return Plotly.relayout(gd, { zaxis: {} });
@@ -533,7 +533,7 @@ describe('Test plot api', function() {
533533
.then(function() {
534534
gd.on('plotly_relayout', function(eventData) {
535535
expect(eventData).toEqual({
536-
title: 'Plotly chart',
536+
title: { text: 'Plotly chart' },
537537
'xaxis.title': 'X',
538538
'xaxis.titlefont': {color: 'green'},
539539
'yaxis.title': 'Y',
@@ -543,7 +543,7 @@ describe('Test plot api', function() {
543543
});
544544

545545
return Plotly.relayout(gd, {
546-
title: 'Plotly chart',
546+
title: { text: 'Plotly chart' },
547547
'xaxis.title': 'X',
548548
'xaxis.titlefont': {color: 'green'},
549549
'yaxis.title': 'Y',
@@ -2283,7 +2283,7 @@ describe('Test plot api', function() {
22832283
it('', function(done) {
22842284
var gd = createGraphDiv();
22852285
var initialData = [];
2286-
var layout = { title: 'Redraw' };
2286+
var layout = { title: { text: 'Redraw' } };
22872287

22882288
Plotly.newPlot(gd, initialData, layout)
22892289
.then(function() {
@@ -2757,7 +2757,7 @@ describe('Test plot api', function() {
27572757
};
27582758

27592759
var layoutUpdate = {
2760-
xaxis: {title: 'A', type: '-'}
2760+
xaxis: { title: { text: 'A' }, type: '-'}
27612761
};
27622762

27632763
Plotly.update(gd, traceUpdate, layoutUpdate).then(function() {

test/jasmine/tests/plots_test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,15 +579,15 @@ describe('Test Plots', function() {
579579
y: [1, 2, 1],
580580
}],
581581
layout: {
582-
title: 'frame A'
582+
title: { text: 'frame A' }
583583
},
584584
name: 'A'
585585
}, null, {
586586
data: [{
587587
y: [1, 2, 3],
588588
}],
589589
layout: {
590-
title: 'frame B'
590+
title: { text: 'frame B' }
591591
},
592592
name: 'B'
593593
}, {

test/jasmine/tests/pointcloud_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ var plotData = {
121121
}
122122
],
123123
layout: {
124-
title: 'Point Cloud - basic',
124+
title: { text: 'Point Cloud - basic' },
125125
xaxis: {
126126
type: 'linear',
127127
range: [

test/jasmine/tests/polar_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ describe('Test relayout on polar subplots:', function() {
473473
theta: [10, 20, 30]
474474
}], {
475475
polar: {
476-
radialaxis: {title: 'yo'}
476+
radialaxis: { title: { text: 'yo' } }
477477
}
478478
})
479479
.then(function() {

0 commit comments

Comments
 (0)