Skip to content

Commit 1fb2ed1

Browse files
committed
test case for warning invocations
1 parent 6d4c86b commit 1fb2ed1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/jasmine/tests/animate_test.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,25 @@ describe('Animate API details', function() {
682682
}).catch(fail).then(done);
683683
});
684684

685+
it('emits warning if strings are not used and this creates ambiguity', function(done) {
686+
spyOn(Lib, 'warn');
687+
Plotly.addFrames(gd, [{name: '8', data: [{x: [8, 7, 6]}]}])
688+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
689+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
690+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
691+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
692+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
693+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
694+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
695+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
696+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
697+
.then(function() {return Plotly.addFrames(gd, [{name: 8, data: [{x: [3, 2, 1]}]}])})
698+
.then(function() {
699+
// Five (`var numericNameWarningCountLimit = 5`) warnings and one warning saying that there won't be more warnings
700+
expect(Lib.warn.calls.count()).toEqual(5 + 1);
701+
}).catch(fail).then(done);
702+
});
703+
685704
it('ignores null and undefined frames', function(done) {
686705
var cnt = 0;
687706
gd.on('plotly_animatingframe', function() {cnt++;});

0 commit comments

Comments
 (0)