Skip to content

Commit

Permalink
finalized tests for the sync tool
Browse files Browse the repository at this point in the history
  • Loading branch information
MV88 committed Nov 16, 2017
1 parent d0ccddc commit 46b25ca
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7,679 deletions.
17 changes: 9 additions & 8 deletions web/client/epics/__tests__/featuregrid-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ const {layerSelectedForSearch, UPDATE_QUERY} = require('../../actions/wfsquery')

const {setHighlightFeaturesPath, triggerDrawSupportOnSelectionChange, featureGridLayerSelectionInitialization, closeCatalogOnFeatureGridOpen, deleteGeometryFeature, onFeatureGridCreateNewFeature, resetGridOnLocationChange, resetQueryPanel, autoCloseFeatureGridEpicOnDrowerOpen, askChangesConfirmOnFeatureGridClose, onClearChangeConfirmedFeatureGrid, onCloseFeatureGridConfirmed, onFeatureGridZoomAll, resetControlsOnEnterInEditMode, closeIdentifyEpic, startSyncWmsFilter, stopSyncWmsFilter, handleDrawFeature, handleEditFeature, resetEditingOnFeatureGridClose, onFeatureGridGeometryEditing, syncMapWmsFilter} = require('../featuregrid');
const {TEST_TIMEOUT, testEpic, addTimeoutEpic} = require('./epicTestUtils');
const {isSyncWmsActive} = require('../../selectors/query');
const {isEmpty, isNil} = require('lodash');
const filterObj = {
featureTypeName: 'MEDIATORE:V_SOTTOPASSO',
Expand Down Expand Up @@ -509,7 +508,7 @@ const stateWithGmlGeometry = {
};

describe('featuregrid Epics', () => {
/*

it('set highlight feature path with geometry not supported EDIT MODE', (done) => {
const epicResult = actions => {
expect(actions.length).toBe(3);
Expand Down Expand Up @@ -1206,21 +1205,23 @@ describe('featuregrid Epics', () => {
});
done();
}, newState);
});*/
});

it('test syncMapWmsFilter with only: spatialField. nativers fetched remotely', (done) => {
it('test syncMapWmsFilter with only: spatialField. nativeCrs fetched "remotely"', (done) => {
const stateFeaturegrid = {
featuregrid: {
open: true,
selectedLayer: "TEST_LAYER",
selectedLayer: "MEDIATORE:V_SOTTOPASSO__6",
mode: 'EDIT',
select: [{id: 'poligoni.1', _new: 'poligoni._new'}],
changes: []
}, layers: {
flat: [{
id: "TEST_LAYER",
title: "Test Layer",
filterObj
id: "MEDIATORE:V_SOTTOPASSO__6",
name: "MEDIATORE:V_SOTTOPASSO",
title: "V_SOTTOPASSO",
filterObj,
url: "base/web/client/test-resources/wms/getCapabilitiesSingleLayer.xml"
}]
}
};
Expand Down
3 changes: 1 addition & 2 deletions web/client/epics/featuregrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,9 +606,8 @@ module.exports = {
return Rx.Observable.fromPromise(
getCapabilities(reqUrl, false)
.then((capabilities) => {
// perform coords Projection to nativeCrs
// reproject coordinates to nativeCrs & update layer with nativeCrs for future
const layerCapability = parseLayerCapabilities(capabilities, objLayer);
// update layer node with native crs
const nativeCrs = head(layerCapability.crs) || "EPSG:3857";
return addFilterNativeCRSToWMSLayer(layerId, reprojectFilterInNativeCrs(filter, nativeCrs), nativeCrs);
})
Expand Down
Loading

0 comments on commit 46b25ca

Please sign in to comment.