Skip to content
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
1 change: 1 addition & 0 deletions test/jasmine/assets/mock_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var svgMockList = [
['sankey_energy', require('@mocks/sankey_energy.json')],
['sunburst_coffee', require('@mocks/sunburst_coffee.json')],
['treemap_coffee', require('@mocks/treemap_coffee.json')],
['icicle_coffee', require('@mocks/icicle_coffee.json')],
['parcats_bad-displayindex', require('@mocks/parcats_bad-displayindex.json')],
['scattercarpet', require('@mocks/scattercarpet.json')],
['shapes', require('@mocks/shapes.json')],
Expand Down
35 changes: 35 additions & 0 deletions test/jasmine/tests/plot_api_react_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,41 @@ describe('Plotly.react and uirevision attributes', function() {
})
.then(done, done.fail);
});

it('preserves icicle level changes', function(done) {
function assertLevel(msg, exp) {
expect(gd._fullData[0].level).toBe(exp, msg);
}

Plotly.react(gd, [{
type: 'icicle',
labels: ['Eve', 'Cain', 'Seth', 'Enos', 'Noam', 'Abel', 'Awan', 'Enoch', 'Azura'],
parents: ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve'],
uirevision: 1
}])
.then(function() {
assertLevel('no set level at start', undefined);
})
.then(function() {
var nodeSeth = d3Select('.slice:nth-child(2)').node();
mouseEvent('click', 0, 0, {element: nodeSeth});
})
.then(function() {
assertLevel('after clicking on Seth sector', 'Seth');
})
.then(function() {
return Plotly.react(gd, [{
type: 'icicle',
labels: ['Eve', 'Cain', 'Seth', 'Enos', 'Noam', 'Abel', 'Awan', 'Enoch', 'Azura', 'Joe'],
parents: ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve', 'Seth'],
uirevision: 1
}]);
})
.then(function() {
assertLevel('after reacting with new data, but with same uirevision', 'Seth');
})
.then(done, done.fail);
});
});

describe('Test Plotly.react + interactions under uirevision:', function() {
Expand Down