Skip to content

Commit

Permalink
fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed May 9, 2017
1 parent 31b477a commit a38eb8e
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions web/client/components/map/openlayers/__tests__/Feature-test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const expect = require('expect');
require('../../../../utils/openlayers/Layers');
require('../plugins/VectorLayer');

describe('Openlayers layer', () => {
describe('Test Feature', () => {
document.body.innerHTML = '<div id="map"></div>';
let map;

Expand Down Expand Up @@ -42,30 +42,30 @@ describe('Openlayers layer', () => {
setTimeout(done);
});

it('creates a vector layer for openlayers map', () => {
it('adding a feature to a vector layer', () => {
var options = {
crs: 'EPSG:4326',
features: {
'type': 'FeatureCollection',
'crs': {
type: 'FeatureCollection',
crs: {
'type': 'name',
'properties': {
'name': 'EPSG:4326'
}
},
'features': [
features: [
{
'type': 'Feature',
'geometry': {
'type': 'Polygon',
'coordinates': [[
type: 'Feature',
geometry: {
type: 'Polygon',
coordinates: [[
[13, 43],
[15, 43],
[15, 44],
[13, 44]
]]
},
'properties': {
properties: {
'name': "some name"
}
}
Expand All @@ -82,9 +82,9 @@ describe('Openlayers layer', () => {
visible: true,
zIndex: 1
});
const geometry = options.features[0].geometry;
const type = options.features[0].type;
const properties = options.features[0].properties;
const geometry = options.features.features[0].geometry;
const type = options.features.features[0].type;
const properties = options.features.features[0].properties;

// create layers
let layer = ReactDOM.render(
Expand All @@ -101,6 +101,6 @@ describe('Openlayers layer', () => {

expect(layer).toExist();
// count layers
expect(container.getSource().getFeatures().getLength()).toBe(1);
expect(container.getSource().getFeatures().length === 1 );
});
});

0 comments on commit a38eb8e

Please sign in to comment.