Skip to content

Commit 94b8b54

Browse files
committed
lint modebar button tests
1 parent 5baa139 commit 94b8b54

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

Diff for: src/components/modebar/buttons.js

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
109
'use strict';
1110

1211
var Registry = require('../../registry');
@@ -44,7 +43,6 @@ var modeBarButtons = module.exports = {};
4443
* @param {boolean} [toggle]
4544
* is the button a toggle button?
4645
*/
47-
4846
modeBarButtons.toImage = {
4947
name: 'toImage',
5048
title: function(gd) {

Diff for: src/snapshot/download.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9-
109
'use strict';
1110

1211
var toImage = require('../plot_api/to_image');
13-
var Lib = require('../lib'); // for isIE
12+
var Lib = require('../lib');
1413
var fileSaver = require('./filesaver');
1514

1615
/** Plotly.downloadImage

Diff for: test/jasmine/tests/modebar_test.js

+11-10
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ var destroyGraphDiv = require('../assets/destroy_graph_div');
1111
var selectButton = require('../assets/modebar_button');
1212
var failTest = require('../assets/fail_test');
1313

14-
1514
describe('ModeBar', function() {
1615
'use strict';
1716

@@ -960,10 +959,11 @@ describe('ModeBar', function() {
960959
Plotly.plot(gd, {data: [], layout: {}})
961960
.then(function() {
962961
selectButton(gd._fullLayout._modeBar, 'toImage').click();
963-
expect(Registry.call).toHaveBeenCalledWith('downloadImage', gd,
964-
{format: 'png'});
965-
done();
966-
});
962+
expect(Registry.call)
963+
.toHaveBeenCalledWith('downloadImage', gd, {format: 'png'});
964+
})
965+
.catch(failTest)
966+
.then(done);
967967
});
968968

969969
it('should accept overriding defaults', function(done) {
@@ -973,13 +973,14 @@ describe('ModeBar', function() {
973973
filename: 'x',
974974
unsupported: 'should not pass'
975975
}
976-
} })
976+
}})
977977
.then(function() {
978978
selectButton(gd._fullLayout._modeBar, 'toImage').click();
979-
expect(Registry.call).toHaveBeenCalledWith('downloadImage', gd,
980-
{format: 'svg', filename: 'x'});
981-
done();
982-
});
979+
expect(Registry.call)
980+
.toHaveBeenCalledWith('downloadImage', gd, {format: 'svg', filename: 'x'});
981+
})
982+
.catch(failTest)
983+
.then(done);
983984
});
984985
});
985986

0 commit comments

Comments
 (0)