Skip to content

Commit 33698d8

Browse files
committed
test: add check on gd.data / gd.layout on Plotly.update
1 parent 4845978 commit 33698d8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/jasmine/tests/plot_api_test.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ describe('Test plot api', function() {
934934
});
935935

936936
describe('Plotly.update should', function() {
937-
var gd, calcdata;
937+
var gd, data, layout, calcdata;
938938

939939
beforeAll(function() {
940940
Object.keys(subroutines).forEach(function(k) {
@@ -945,6 +945,8 @@ describe('Test plot api', function() {
945945
beforeEach(function(done) {
946946
gd = createGraphDiv();
947947
Plotly.plot(gd, [{ y: [2, 1, 2] }]).then(function() {
948+
data = gd.data;
949+
layout = gd.layout;
948950
calcdata = gd.calcdata;
949951
done();
950952
});
@@ -964,6 +966,8 @@ describe('Test plot api', function() {
964966

965967
it('clear calcdata on data updates', function(done) {
966968
Plotly.update(gd, { x: [[3, 1, 3]] }).then(function() {
969+
expect(data).toBe(gd.data);
970+
expect(layout).toBe(gd.layout);
967971
expect(calcdata).not.toBe(gd.calcdata);
968972
done();
969973
});

0 commit comments

Comments
 (0)