Skip to content

Commit e7c034a

Browse files
committed
texttemplate: test that trace.meta is passed to template
1 parent 2f6bf8a commit e7c034a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: test/jasmine/assets/check_texttemplate.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,26 @@ module.exports = function checkTextTemplate(mock, selector, tests) {
2222
expect(gd._fullData[0].textinfo).toBe(undefined);
2323
});
2424

25-
// Generate customdata
25+
2626
var N = tests[0][1].length;
27+
var i;
28+
29+
// Generate customdata
2730
var customdata = [];
28-
for(var i = 0; i < N; i++) {
31+
for(i = 0; i < N; i++) {
2932
customdata.push(Lib.randstr({}));
3033
}
3134
mock[0].customdata = customdata;
3235
tests.push(['%{customdata}', customdata]);
3336

37+
// Generate meta
38+
mock[0].meta = {'colname': 'A'};
39+
var metaSolution = [];
40+
for(i = 0; i < N; i++) {
41+
metaSolution.push(mock[0].meta.colname);
42+
}
43+
tests.push(['%{meta.colname}', metaSolution]);
44+
3445
if(isGL) {
3546
tests.forEach(function(test) {
3647
it('@gl should support texttemplate', function(done) {

0 commit comments

Comments
 (0)