Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cbd2e7d

Browse files
committed
Add test for placing animate on main queue
1 parent be9bcb6 commit cbd2e7d

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/jasmine/tests/animate_test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -768,4 +768,30 @@ describe('animating scatter traces', function() {
768768
expect(trace.style('opacity')).toEqual('0.1');
769769
}).catch(fail).then(done);
770770
});
771+
772+
it('places animate on the main plotly.js queue', function(done) {
773+
Plotly.plot(gd, [{
774+
x: [1, 2, 3],
775+
y: [4, 5, 6],
776+
opacity: 1
777+
}]).then(function() {
778+
gd._promises.push(delay(100)());
779+
var checked = false;
780+
781+
Plotly.animate(gd, [{
782+
data: [{'line.color': 'red'}]
783+
}], {
784+
frame: {duration: 0, redraw: false},
785+
mode: 'immediate'
786+
}).then(function() {
787+
expect(gd._fullData[0].line.color).toBe('red');
788+
expect(checked).toBe(true);
789+
}).catch(fail).then(done);
790+
791+
setTimeout(function() {
792+
expect(gd._fullData[0].line.color).not.toBe('red');
793+
checked = true;
794+
}, 50);
795+
}).catch(fail);
796+
});
771797
});

0 commit comments

Comments
 (0)