Skip to content

Commit 6ac1dc5

Browse files
committed
add jasmine tests of waterfall textinfo coerce
1 parent bed6842 commit 6ac1dc5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/jasmine/tests/waterfall_test.js

+19
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,25 @@ describe('Waterfall.supplyDefaults', function() {
125125
expect(traceOut.constraintext).toBeUndefined();
126126
});
127127

128+
it('should not coerce textinfo when textposition is none', function() {
129+
traceIn = {
130+
y: [1, 2, 3],
131+
textinfo: 'value'
132+
};
133+
supplyDefaults(traceIn, traceOut, defaultColor, {});
134+
expect(traceOut.textinfo).toBeUndefined();
135+
});
136+
137+
it('should coerce textinfo when textposition is not none', function() {
138+
traceIn = {
139+
y: [1, 2, 3],
140+
textposition: 'auto',
141+
textinfo: 'text'
142+
};
143+
supplyDefaults(traceIn, traceOut, defaultColor, {});
144+
expect(traceOut.textinfo).not.toBeUndefined();
145+
});
146+
128147
it('should default textfont to layout.font except for insidetextfont.color', function() {
129148
traceIn = {
130149
textposition: 'inside',

0 commit comments

Comments
 (0)