Skip to content

More newPlot calls in tests #5393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion devtools/test_dashboard/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var Tabs = {
var mockURL = '/test/image/mocks/' + mockName + '.json';

d3.json(mockURL, function(err, fig) {
Plotly.plot(Tabs.fresh(id), fig);
Plotly.newPlot(Tabs.fresh(id), fig);

console.warn('Plotting:', mockURL);
});
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/assets/check_component.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = function checkComponent(Plotly) {

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, mock.data, mock.layout).then(done);
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down Expand Up @@ -74,7 +74,7 @@ module.exports = function checkComponent(Plotly) {

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, mock.data, mock.layout).then(done);
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/assets/check_event_data.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function checkEventData(mock, x, y, additionalFields) {
beforeEach(function(done) {
gd = createGraphDiv();

Plotly.plot(gd, mockCopy.data, mockCopy.layout)
Plotly.newPlot(gd, mockCopy.data, mockCopy.layout)
.then(done);
});

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/assets/fail_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @example
*
* Plotly.plot(...)
* Plotly.newPlot(...)
* .then(function(gd) {
* assert(...);
* assert(...);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/bar_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Bundle with bar', function() {
var mock = require('@mocks/bar_line.json');

beforeEach(function(done) {
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/choropleth_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('Bundle with choropleth', function() {
afterEach(destroyGraphDiv);

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

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/contour_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('Bundle with contour', function() {
var mock = require('@mocks/contour_scatter.json');

beforeEach(function(done) {
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/core_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('Bundle with core only', function() {

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, mock.data, mock.layout).then(done);
Plotly.newPlot(gd, mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/finance_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Bundle with finance trace type', function() {
});

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

expect(gSubplot.selectAll('g.trace.ohlc').size()).toEqual(1);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/histogram2dcontour_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('Bundle with histogram2dcontour and histogram', function() {
var mock = require('@mocks/2dhistogram_contour_subplots.json');

beforeEach(function(done) {
Plotly.plot(createGraphDiv(), mock.data, mock.layout).then(done);
Plotly.newPlot(createGraphDiv(), mock.data, mock.layout).then(done);
});

afterEach(destroyGraphDiv);
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/bundle_tests/mathjax_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('Test MathJax:', function() {
function testTitleScoot(fig, opts) {
var xCategories = opts.xCategories;

return Plotly.plot(gd, fig)
return Plotly.newPlot(gd, fig)
.then(function() { assertNoIntersect('base'); })
.then(function() { return Plotly.relayout(gd, 'xaxis.titlefont.size', 40); })
.then(function() { assertNoIntersect('large title font size'); })
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/contour_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,13 +639,13 @@ describe('contour hover', function() {
afterAll(destroyGraphDiv);

it('should not display hover on missing data and hoverongaps is disabled', function() {
var pt = _hover(gd, 10, 100)[0];

var hoverData;
gd.on('plotly_hover', function(data) {
hoverData = data;
});

var pt = _hover(gd, 10, 100)[0];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch 🤦


expect(hoverData).toEqual(undefined);
expect(pt).toEqual(undefined);
});
Expand Down
Loading