2019-10-08 19:20:12 +08:00
|
|
|
import geojson from '../../src/parser/geojson';
|
2019-12-02 15:16:45 +08:00
|
|
|
import multiLine from '../data/multiLine';
|
|
|
|
import multiPolygon from '../data/multipolygon';
|
2019-10-08 19:20:12 +08:00
|
|
|
import polygon from '../data/polygon';
|
|
|
|
describe('parser.geojson', () => {
|
|
|
|
it('parser json', () => {
|
|
|
|
const result = geojson(polygon);
|
|
|
|
expect(result.dataArray.length).toEqual(3);
|
|
|
|
});
|
2019-12-02 15:16:45 +08:00
|
|
|
it('parser multiPolygon', () => {
|
|
|
|
const result = geojson(multiPolygon);
|
2020-07-03 20:15:36 +08:00
|
|
|
expect(result.dataArray.length).toEqual(1);
|
2019-12-02 15:16:45 +08:00
|
|
|
expect(result.dataArray[0]._id).toEqual(0);
|
|
|
|
});
|
|
|
|
it('parset multiLine', () => {
|
|
|
|
const result = geojson(multiLine);
|
|
|
|
expect(result.dataArray.length).toEqual(2);
|
2019-10-08 19:20:12 +08:00
|
|
|
});
|
|
|
|
});
|