Skip to content

Commit 5962af9

Browse files
committed
Added test
1 parent 54269a6 commit 5962af9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/jasmine/tests/sankey_test.js

+28
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,34 @@ describe('sankey tests', function() {
10731073
})
10741074
.then(done, done.fail);
10751075
});
1076+
1077+
it('should (un-)highlight all traces ending in a (un-)hovered node', function(done) {
1078+
var gd = createGraphDiv();
1079+
var mockCopy = Lib.extendDeep({}, mock);
1080+
1081+
Plotly.newPlot(gd, mockCopy)
1082+
.then(function() {
1083+
_hover(1000, 400);
1084+
})
1085+
.then(function() {
1086+
d3SelectAll('.sankey-link')
1087+
.filter(function(obj) {
1088+
return obj.link.label === 'stream 1';
1089+
})[0].forEach(function(l) {
1090+
expect(l.style.fillOpacity).toEqual('0.4');
1091+
});
1092+
}).then(function() {
1093+
mouseEvent('mouseout', 1000, 400);
1094+
}).then(function() {
1095+
d3SelectAll('.sankey-link')
1096+
.filter(function(obj) {
1097+
return obj.link.label === 'stream 1';
1098+
})[0].forEach(function(l) {
1099+
expect(l.style.fillOpacity).toEqual('0.2');
1100+
});
1101+
})
1102+
.then(done, done.fail);
1103+
});
10761104
});
10771105

10781106
describe('Test hover/click event data:', function() {

0 commit comments

Comments
 (0)