Skip to content

Commit 21c6c78

Browse files
committed
add jasmine test for scattergeo
1 parent efc1199 commit 21c6c78

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

test/jasmine/tests/geo_test.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,43 @@ describe('Test geo zoom/pan/drag interactions:', function() {
27322732
});
27332733
});
27342734

2735+
describe('Test geo interactions update marker angles:', function() {
2736+
var gd;
2737+
2738+
beforeEach(function() { gd = createGraphDiv(); });
2739+
2740+
afterEach(destroyGraphDiv);
2741+
2742+
function getPath() {
2743+
return d3Select('.scattergeo .point').node().getAttribute('d');
2744+
}
2745+
2746+
it('update angles when panning', function(done) {
2747+
var fig = Lib.extendDeep({}, require('@mocks/geo_conic-conformal'));
2748+
fig.layout.width = 700;
2749+
fig.layout.height = 500;
2750+
fig.layout.dragmode = 'pan';
2751+
2752+
var initialPath, newPath;
2753+
2754+
Plotly.newPlot(gd, fig)
2755+
.then(function() {
2756+
initialPath = getPath();
2757+
2758+
return drag({path: [[300, 200], [350, 250], [400, 300]], noCover: true});
2759+
})
2760+
.then(function() {
2761+
newPath = getPath();
2762+
expect(newPath).toEqual('M0,0L18.238949513733473,8.206139204003389L19.579067718529352,-4.081679467234269Z');
2763+
2764+
expect(newPath).not.toEqual(initialPath);
2765+
expect(newPath).toEqual('M0,0L18.238949513733473,8.206139204003389L19.579067718529352,-4.081679467234269Z');
2766+
expect(initialPath).toEqual('M0,0L-1.5033314641545745,19.94341982983066L10.506227353572104,17.01820163222463Z');
2767+
})
2768+
.then(done, done.fail);
2769+
});
2770+
});
2771+
27352772
describe('plotly_relayouting', function() {
27362773
var gd;
27372774
var events;

0 commit comments

Comments
 (0)