Skip to content

Commit c12ff4a

Browse files
committed
add eventdata test for angular drag of gridshape: 'linear' subplts
1 parent 2bf3107 commit c12ff4a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/jasmine/tests/polar_test.js

+16
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,8 @@ describe('Test polar *gridshape linear* interactions', function() {
11381138
});
11391139

11401140
it('should rotate all non-symmetrical layers on angular drag', function(done) {
1141+
var evtCnt = 0;
1142+
var evtData = {};
11411143
var dragCoverNode;
11421144
var p1;
11431145

@@ -1194,6 +1196,12 @@ describe('Test polar *gridshape linear* interactions', function() {
11941196
height: 400,
11951197
margin: {l: 50, t: 50, b: 50, r: 50}
11961198
})
1199+
.then(function() {
1200+
gd.on('plotly_relayout', function(d) {
1201+
evtCnt++;
1202+
evtData = d;
1203+
});
1204+
})
11971205
.then(function() {
11981206
layersRotateFromZero.forEach(function(q) {
11991207
_assertTransformRotate('base', q, null);
@@ -1209,6 +1217,14 @@ describe('Test polar *gridshape linear* interactions', function() {
12091217
fromRadialAxis: -82.8
12101218
});
12111219
})
1220+
.then(function() {
1221+
expect(evtCnt).toBe(1, '# of plotly_relayout calls');
1222+
expect(evtData['polar.angularaxis.rotation'])
1223+
.toBeCloseTo(82.8, 1, 'polar.angularaxis.rotation event data');
1224+
// have to rotate radial axis too here, to ensure it remains 'on scale'
1225+
expect(evtData['polar.radialaxis.angle'])
1226+
.toBeCloseTo(82.8, 1, 'polar.radialaxis.angle event data');
1227+
})
12121228
.catch(failTest)
12131229
.then(done);
12141230
});

0 commit comments

Comments
 (0)