Skip to content

Commit

Permalink
Added test
Browse files Browse the repository at this point in the history
  • Loading branch information
CelineWuest committed Dec 15, 2023
1 parent 54269a6 commit 5962af9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/jasmine/tests/sankey_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,34 @@ describe('sankey tests', function() {
})
.then(done, done.fail);
});

it('should (un-)highlight all traces ending in a (un-)hovered node', function(done) {
var gd = createGraphDiv();
var mockCopy = Lib.extendDeep({}, mock);

Plotly.newPlot(gd, mockCopy)
.then(function() {
_hover(1000, 400);
})
.then(function() {
d3SelectAll('.sankey-link')
.filter(function(obj) {
return obj.link.label === 'stream 1';
})[0].forEach(function(l) {
expect(l.style.fillOpacity).toEqual('0.4');
});
}).then(function() {
mouseEvent('mouseout', 1000, 400);
}).then(function() {
d3SelectAll('.sankey-link')
.filter(function(obj) {
return obj.link.label === 'stream 1';
})[0].forEach(function(l) {
expect(l.style.fillOpacity).toEqual('0.2');
});
})
.then(done, done.fail);
});
});

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

0 comments on commit 5962af9

Please sign in to comment.