Skip to content

Commit 9330290

Browse files
committed
texttemplate: test that textinfo is not coerced when it's defined
1 parent ee0a309 commit 9330290

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: src/plots/texttemplate_attributes.js

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ module.exports = function(opts, extra) {
3232
var texttemplate = {
3333
valType: 'string',
3434
role: 'info',
35-
dflt: '',
3635
editType: opts.editType || 'calc',
3736
description: [
3837
'Template string used for rendering the information that appear on points.',

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

+10
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@ var Lib = require('@src/lib');
33
var failTest = require('../assets/fail_test');
44
var createGraphDiv = require('../assets/create_graph_div');
55
var destroyGraphDiv = require('../assets/destroy_graph_div');
6+
var supplyAllDefaults = require('../assets/supply_defaults');
67

78
'use strict';
89

910
module.exports = function checkTextTemplate(mock, selector, tests) {
11+
it('should not coerce textinfo when texttemplate', function() {
12+
var gd = {};
13+
gd.data = Lib.extendDeep(mock, {});
14+
gd.data[0].textinfo = 'text';
15+
gd.data[0].texttemplate = tests[0][0];
16+
supplyAllDefaults(gd);
17+
expect(gd._fullData[0].textinfo).toBe(undefined);
18+
});
19+
1020
tests.forEach(function(test) {
1121
it('should support textemplate', function(done) {
1222
var gd = createGraphDiv();

0 commit comments

Comments
 (0)