Skip to content

Commit cecb4e5

Browse files
authored
Merge pull request #5393 from plotly/more-newPlot-in-tests
More newPlot calls in tests
2 parents b2f15e5 + 981cc40 commit cecb4e5

21 files changed

+222
-144
lines changed

devtools/test_dashboard/devtools.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ var Tabs = {
6060
var mockURL = '/test/image/mocks/' + mockName + '.json';
6161

6262
d3.json(mockURL, function(err, fig) {
63-
Plotly.plot(Tabs.fresh(id), fig);
63+
Plotly.newPlot(Tabs.fresh(id), fig);
6464

6565
console.warn('Plotting:', mockURL);
6666
});

test/jasmine/assets/check_component.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module.exports = function checkComponent(Plotly) {
3838

3939
beforeEach(function(done) {
4040
gd = createGraphDiv();
41-
Plotly.plot(gd, mock.data, mock.layout).then(done);
41+
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
4242
});
4343

4444
afterEach(destroyGraphDiv);
@@ -74,7 +74,7 @@ module.exports = function checkComponent(Plotly) {
7474

7575
beforeEach(function(done) {
7676
gd = createGraphDiv();
77-
Plotly.plot(gd, mock.data, mock.layout).then(done);
77+
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
7878
});
7979

8080
afterEach(destroyGraphDiv);

test/jasmine/assets/check_event_data.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function checkEventData(mock, x, y, additionalFields) {
1414
beforeEach(function(done) {
1515
gd = createGraphDiv();
1616

17-
Plotly.plot(gd, mockCopy.data, mockCopy.layout)
17+
Plotly.newPlot(gd, mockCopy.data, mockCopy.layout)
1818
.then(done);
1919
});
2020

test/jasmine/assets/fail_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
* @example
99
*
10-
* Plotly.plot(...)
10+
* Plotly.newPlot(...)
1111
* .then(function(gd) {
1212
* assert(...);
1313
* assert(...);

test/jasmine/bundle_tests/bar_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Bundle with bar', function() {
1515
var mock = require('@mocks/bar_line.json');
1616

1717
beforeEach(function(done) {
18-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
18+
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
1919
});
2020

2121
afterEach(destroyGraphDiv);

test/jasmine/bundle_tests/choropleth_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Bundle with choropleth', function() {
2626
afterEach(destroyGraphDiv);
2727

2828
it('should graph choropleth traces', function(done) {
29-
Plotly.plot(gd, mock.data, mock.layout)
29+
Plotly.newPlot(gd, mock.data, mock.layout)
3030
.then(function() {
3131
var nodes = d3.selectAll('g.trace.choropleth');
3232

test/jasmine/bundle_tests/contour_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('Bundle with contour', function() {
1515
var mock = require('@mocks/contour_scatter.json');
1616

1717
beforeEach(function(done) {
18-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
18+
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
1919
});
2020

2121
afterEach(destroyGraphDiv);

test/jasmine/bundle_tests/core_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ describe('Bundle with core only', function() {
1414

1515
beforeEach(function(done) {
1616
gd = createGraphDiv();
17-
Plotly.plot(gd, mock.data, mock.layout).then(done);
17+
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
1818
});
1919

2020
afterEach(destroyGraphDiv);

test/jasmine/bundle_tests/finance_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('Bundle with finance trace type', function() {
2828
});
2929

3030
it('should graph ohlc and candlestick traces', function(done) {
31-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(function() {
31+
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(function() {
3232
var gSubplot = d3.select('g.cartesianlayer');
3333

3434
expect(gSubplot.selectAll('g.trace.ohlc').size()).toEqual(1);

test/jasmine/bundle_tests/histogram2dcontour_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Bundle with histogram2dcontour and histogram', function() {
1616
var mock = require('@mocks/2dhistogram_contour_subplots.json');
1717

1818
beforeEach(function(done) {
19-
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
19+
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
2020
});
2121

2222
afterEach(destroyGraphDiv);

test/jasmine/bundle_tests/mathjax_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Test MathJax:', function() {
5656
function testTitleScoot(fig, opts) {
5757
var xCategories = opts.xCategories;
5858

59-
return Plotly.plot(gd, fig)
59+
return Plotly.newPlot(gd, fig)
6060
.then(function() { assertNoIntersect('base'); })
6161
.then(function() { return Plotly.relayout(gd, 'xaxis.titlefont.size', 40); })
6262
.then(function() { assertNoIntersect('large title font size'); })

test/jasmine/tests/contour_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,13 +639,13 @@ describe('contour hover', function() {
639639
afterAll(destroyGraphDiv);
640640

641641
it('should not display hover on missing data and hoverongaps is disabled', function() {
642-
var pt = _hover(gd, 10, 100)[0];
643-
644642
var hoverData;
645643
gd.on('plotly_hover', function(data) {
646644
hoverData = data;
647645
});
648646

647+
var pt = _hover(gd, 10, 100)[0];
648+
649649
expect(hoverData).toEqual(undefined);
650650
expect(pt).toEqual(undefined);
651651
});

0 commit comments

Comments
 (0)