Skip to content

Commit 5a5702f

Browse files
committed
adding a jasmine test to lock issue 3630
1 parent 6519021 commit 5a5702f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

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

+39
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,45 @@ describe('Click-to-select', function() {
688688
}
689689
});
690690

691+
it('should maintain style of errorbars after double click cleared selection (bar case)', function(done) {
692+
Plotly.newPlot(gd, { // Note: this call should be newPlot not plot
693+
data: [{
694+
x: [0, 1, 2],
695+
y: [100, 200, 400],
696+
type: 'bar',
697+
marker: {
698+
color: 'yellow'
699+
},
700+
error_y: {
701+
type: 'sqrt'
702+
}
703+
}],
704+
layout: {
705+
dragmode: 'select'
706+
}
707+
})
708+
.then(function() {
709+
var x = 100;
710+
var y = 100;
711+
drag([[x, y], [x, y]]); // first empty drag
712+
return doubleClick(x, y); // then double click
713+
})
714+
.then(function() {
715+
assertSelectionCleared();
716+
})
717+
.then(function() {
718+
d3.select(gd).select('g.plot').each(function() {
719+
d3.select(this).selectAll('g.errorbar').selectAll('path').each(function() {
720+
expect(d3.select(this).attr('style'))
721+
.toBe('vector-effect: non-scaling-stroke; stroke-width: 2px; stroke: rgb(68, 68, 68); stroke-opacity: 1; opacity: 1; fill: rgb(255, 255, 0); fill-opacity: 1;', 'to be visible'
722+
);
723+
});
724+
});
725+
})
726+
.catch(failTest)
727+
.then(done);
728+
});
729+
691730
describe('triggers \'plotly_selected\' before \'plotly_click\'', function() {
692731
[
693732
testCase('cartesian', require('@mocks/14.json'), 270, 160, [7]),

0 commit comments

Comments
 (0)