Skip to content

Commit

Permalink
geosolutions-it#10026: Interactive legend for TOC layers [WMS]
Browse files Browse the repository at this point in the history
* revert wrong pushed code into test file
  • Loading branch information
mahmoudadel54 authored Apr 19, 2024
1 parent 2c0eaa0 commit 65e5deb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions web/client/reducers/__tests__/queryform-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,46 @@ describe('Test the queryform reducer', () => {
const newState2 = queryform(newState1, action2);
expect(newState2.filters.length).toBe(0);
});
it('test loadFilter when crossLayerExpanded is undefined', () => {
const newFilter = {
crossLayerFilter: {
collectGeometries: {
queryCollection: {

}
}
},
filters: [{
format: "logic",
logic: "AND",
filters: [{
format: 'cql',
body: 'ATTRIBUTE1 = \'VALUE1\''
}]
}],
spatialField: {
method: "BBOX",
operation: "DWITHIN",
geometry: '{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-635956.0753326667,5466776.262955805],[-635956.0753326667,4723196.8517976105],[-29351.81886150781,4723196.8517976105],[-29351.81886150781,5466776.262955805],[-635956.0753326667,5466776.262955805]]]},"properties":null}'
}

};
const initialState = {
crossLayerExpanded: undefined,
crossLayerFilter: {
attribute: "ATTRIBUTE1"
},
spatialField: {
attribute: "GEOMETRY"
}
};
let action = loadFilter(newFilter);
let newState = queryform(initialState, action);
expect(newState.crossLayerFilter.attribute).toBe("ATTRIBUTE1");
expect(newState.spatialField.attribute).toBe("GEOMETRY");
expect(newState.spatialField.method).toBe("BBOX");
expect(newState.filters).toEqual(newFilter.filters);
});


/* it('Open Zones Menu', () => {
Expand Down

0 comments on commit 65e5deb

Please sign in to comment.