Skip to content

Commit 4d10983

Browse files
committed
test: add case for finance chart dflt trace name
1 parent a98a123 commit 4d10983

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/jasmine/tests/finance_test.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,35 @@ describe('finance charts defaults:', function() {
220220
]);
221221
});
222222

223+
it('trace *name* default should make reference to user data trace indices', function() {
224+
var trace0 = Lib.extendDeep({}, mock0, {
225+
type: 'ohlc'
226+
});
227+
228+
var trace1 = { type: 'scatter' };
229+
230+
var trace2 = Lib.extendDeep({}, mock1, {
231+
type: 'candlestick',
232+
});
233+
234+
var trace3 = { type: 'bar' };
235+
236+
var out = _supply([trace0, trace1, trace2, trace3]);
237+
238+
var names = out._fullData.map(function(fullTrace) {
239+
return fullTrace.name;
240+
});
241+
242+
expect(names).toEqual([
243+
'trace 0 - increasing',
244+
'trace 0 - decreasing',
245+
'trace 1',
246+
'trace 2 - increasing',
247+
'trace 2 - decreasing',
248+
'trace 3'
249+
]);
250+
});
251+
223252
it('trace-wide styling should set default for corresponding per-direction styling', function() {
224253
function assertLine(cont, width, dash) {
225254
expect(cont.line.width).toEqual(width);

0 commit comments

Comments
 (0)