Skip to content

Commit 44b4e70

Browse files
committed
Ternary: Add test for restyle updates
1 parent cbfb4c9 commit 44b4e70

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

test/jasmine/tests/ternary_test.js

+16-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ describe('ternary plots', function() {
8888
});
8989
});
9090

91+
it('should be able to restyle', function(done) {
92+
Plotly.restyle(gd, { a: [[1,2,3]]}, 0).then(function() {
93+
var transforms = [];
94+
d3.selectAll('.ternary .point').each(function() {
95+
var point = d3.select(this);
96+
transforms.push(point.attr('transform'));
97+
});
98+
99+
expect(transforms).toEqual([
100+
'translate(186.45,209.8)',
101+
'translate(118.53,170.59)',
102+
'translate(248.76,117.69)'
103+
]);
104+
}).then(done);
105+
});
106+
91107
it('should display to hover labels', function() {
92108
var hoverLabels;
93109

@@ -180,7 +196,6 @@ describe('ternary plots', function() {
180196
done();
181197
});
182198
});
183-
184199
});
185200

186201
function countTernarySubplot() {

0 commit comments

Comments
 (0)