Skip to content

Commit d69f8a4

Browse files
committed
improve jasmine tests for textinfo
1 parent a598343 commit d69f8a4

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

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

+17
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,23 @@ describe('A funnel plot', function() {
11691169
})
11701170
.then(function() {
11711171
_assertNumberOfFunnelTextNodes(3);
1172+
return Plotly.restyle(gd, 'textinfo', 'text');
1173+
})
1174+
.then(function() {
1175+
_assertNumberOfFunnelTextNodes(3);
1176+
return Plotly.restyle(gd, 'text', [[null, 0, '']]);
1177+
})
1178+
.then(function() {
1179+
// N.B. that '0' should be there!
1180+
_assertNumberOfFunnelTextNodes(1);
1181+
return Plotly.restyle(gd, 'textinfo', 'value');
1182+
})
1183+
.then(function() {
1184+
_assertNumberOfFunnelTextNodes(3);
1185+
return Plotly.restyle(gd, 'textposition', 'none');
1186+
})
1187+
.then(function() {
1188+
_assertNumberOfFunnelTextNodes(0);
11721189
})
11731190
.catch(failTest)
11741191
.then(done);

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

+17
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,23 @@ describe('A waterfall plot', function() {
11221122
})
11231123
.then(function() {
11241124
_assertNumberOfWaterfallTextNodes(3);
1125+
return Plotly.restyle(gd, 'textinfo', 'text');
1126+
})
1127+
.then(function() {
1128+
_assertNumberOfWaterfallTextNodes(3);
1129+
return Plotly.restyle(gd, 'text', [[null, 0, '']]);
1130+
})
1131+
.then(function() {
1132+
// N.B. that '0' should be there!
1133+
_assertNumberOfWaterfallTextNodes(1);
1134+
return Plotly.restyle(gd, 'textinfo', 'delta');
1135+
})
1136+
.then(function() {
1137+
_assertNumberOfWaterfallTextNodes(3);
1138+
return Plotly.restyle(gd, 'textposition', 'none');
1139+
})
1140+
.then(function() {
1141+
_assertNumberOfWaterfallTextNodes(0);
11251142
})
11261143
.catch(failTest)
11271144
.then(done);

0 commit comments

Comments
 (0)