-
Notifications
You must be signed in to change notification settings - Fork 22
/
AnimateUtil.spec.js
41 lines (34 loc) · 1.1 KB
/
AnimateUtil.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*eslint-env jest*/
import OlGeomPoint from 'ol/geom/Point';
import OlFeature from 'ol/Feature';
import OlStyleStyle from 'ol/style/Style';
import AnimateUtil from '../AnimateUtil/AnimateUtil';
import TestUtil from '../TestUtil';
describe('AnimateUtil', () => {
describe('Basics', () => {
it('is defined', () => {
expect(AnimateUtil).toBeDefined();
});
});
describe('Static methods', () => {
describe('#moveFeature', () => {
it('is defined', () => {
expect(AnimateUtil.moveFeature).toBeDefined();
});
it('moves feature to the new position', () => {
// the next line show this test isn't testing anything
// expect.assertions(1);
const coords = [0, 0];
const geom = new OlGeomPoint(coords);
const featToMove = new OlFeature(geom);
let map = TestUtil.createMap();
AnimateUtil.moveFeature(
map, featToMove, 100, 50, new OlStyleStyle()
).then((feat) => {
expect(feat.getGeometry().getCoordinates()).toEqual([50, 50]);
});
TestUtil.removeMap(map);
});
});
});
});