Skip to content

Commit 60de2ff

Browse files
committed
Add test case: data changed, but revision is not
1 parent 4bedf33 commit 60de2ff

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/__tests__/react-plotly.test.js

+18
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,24 @@ describe('<Plotly/>', () => {
102102
.catch(err => done.fail(err));
103103
});
104104

105+
test('updates data when revision is defined but not changed', done => {
106+
createPlot({
107+
revision: 1,
108+
layout: {width: 123, height: 456},
109+
onUpdate: once(() => {
110+
expectPlotlyAPICall(Plotly.react, {
111+
data: [{x: [1, 2, 3]}],
112+
layout: {width: 123, height: 456},
113+
});
114+
done();
115+
}),
116+
})
117+
.then(plot => {
118+
plot.setProps({revision: 1, data: [{x: [1, 2, 3]}]});
119+
})
120+
.catch(err => done.fail(err));
121+
});
122+
105123
test('sets the title', done => {
106124
createPlot({
107125
onUpdate: once(() => {

0 commit comments

Comments
 (0)