Skip to content

Commit 89335f6

Browse files
committed
added test
1 parent ba22460 commit 89335f6

3 files changed

Lines changed: 44 additions & 17 deletions

File tree

web/client/components/misc/ConfirmDialog.jsx

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1+
/*
2+
* Copyright 2016, GeoSolutions Sas.
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the BSD-style license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
*/
18
const PropTypes = require('prop-types');
2-
/**
3-
* Copyright 2016, GeoSolutions Sas.
4-
* All rights reserved.
5-
*
6-
* This source code is licensed under the BSD-style license found in the
7-
* LICENSE file in the root directory of this source tree.
8-
*/
9-
/**
10-
* Copyright 2016, GeoSolutions Sas.
11-
* All rights reserved.
12-
*
13-
* This source code is licensed under the BSD-style license found in the
14-
* LICENSE file in the root directory of this source tree.
15-
*/
16-
179
const React = require('react');
18-
1910
const {Button, ButtonGroup, Glyphicon} = require('react-bootstrap');
2011

2112
const Dialog = require('./Dialog');

web/client/selectors/__tests__/query-test.js

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@
99
const expect = require('expect');
1010
const {
1111
wfsURL,
12+
wfsURLSelector,
1213
wfsFilter,
14+
typeNameSelector,
1315
resultsSelector,
1416
featureCollectionResultSelector,
1517
paginationInfo,
1618
featureLoadingSelector,
1719
isDescribeLoaded,
1820
describeSelector,
1921
getFeatureById,
20-
attributesSelector
22+
attributesSelector,
23+
isSyncWmsActive
2124
} = require('../query');
2225

2326
const idFt1 = "idFt1";
@@ -271,6 +274,7 @@ const initialState = {
271274
},
272275
searchUrl: 'http://localhost:8081/geoserver/wfs?',
273276
typeName: 'editing:polygons',
277+
syncWmsFilter: true,
274278
url: 'http://localhost:8081/geoserver/wfs?',
275279
featureLoading: false
276280
},
@@ -290,6 +294,21 @@ describe('Test query selectors', () => {
290294
expect(searchUrl).toExist();
291295
expect(searchUrl).toBe("http://localhost:8081/geoserver/wfs?");
292296
});
297+
it('test wfsURLSelector selector', () => {
298+
const url = wfsURLSelector(initialState);
299+
expect(url).toExist();
300+
expect(url).toBe("http://localhost:8081/geoserver/wfs?");
301+
});
302+
it('test typeNameSelector selector', () => {
303+
const typename = typeNameSelector(initialState);
304+
expect(typename).toExist();
305+
expect(typename).toBe("editing:polygons");
306+
});
307+
it('test isSyncWmsActive selector', () => {
308+
const sync = isSyncWmsActive(initialState);
309+
expect(sync).toExist();
310+
expect(sync).toBe(true);
311+
});
293312
it('test wfsFilter selector', () => {
294313
const filterObj = wfsFilter(initialState);
295314
expect(filterObj).toExist();

web/client/utils/__tests__/ConfigUtils-test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,23 @@ describe('ConfigUtils', () => {
245245
expect(retval.configUrl).toBe(testval.configUrl);
246246
expect(retval.legacy).toBe(testval.legacy);
247247
});
248+
it('getParsedUrl with valid url ending with wfs', () => {
249+
const url = "http://somepath/wfs";
250+
const testval = "http://somepath/wps?service=WPS";
251+
const retval = ConfigUtils.getParsedUrl(url, {});
252+
expect(retval).toExist();
253+
expect(retval).toBe(testval);
254+
});
255+
it('getParsedUrl with valid url ending with asd return null', () => {
256+
const url = "http://somepath/asd";
257+
const retval = ConfigUtils.getParsedUrl(url, {});
258+
expect(retval).toBe(null);
259+
});
260+
it('getParsedUrl with not valid url', () => {
261+
const url = null;
262+
const retval = ConfigUtils.getParsedUrl(url, {});
263+
expect(retval).toBe(null);
264+
});
248265

249266
it('loadConfiguration', (done) => {
250267
var retval = ConfigUtils.loadConfiguration();

0 commit comments

Comments
 (0)