-
Notifications
You must be signed in to change notification settings - Fork 405
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…1664) * fixed #1634 added support to custom search services and minor fixes * clean up code * fixed indentation * fixed test * fixed test * improved a test
- Loading branch information
Showing
9 changed files
with
239 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,7 +90,7 @@ module.exports = { | |
}], | ||
"toolsOptions": { | ||
"test": { | ||
"label": "ciao" | ||
"label": "Hello" | ||
} | ||
... | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Copyright 2017, GeoSolutions Sas. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
const expect = require('expect'); | ||
const {API} = require('../searchText'); | ||
const axios = require('axios'); | ||
|
||
describe('Test correctness of the searchText APIs', () => { | ||
|
||
const myFun = (param) => { | ||
// do stuff | ||
return param; | ||
}; | ||
function fun() { | ||
return axios.get('base/web/client/test-resources/featureCollectionZone.js'); | ||
} | ||
|
||
it('setter and getter services', (done) => { | ||
let servName = "myService"; | ||
API.Utils.setService(servName, myFun); | ||
try { | ||
expect(API.Services).toExist(); | ||
expect(API.Services[servName]).toExist(); | ||
expect(API.Utils.getService(servName)).toExist(); | ||
done(); | ||
} catch(ex) { | ||
done(ex); | ||
} | ||
}); | ||
|
||
let serviceType = 'myCustomService'; | ||
it('setService', (done) => { | ||
API.Utils.setService(serviceType, fun); | ||
expect(API.Utils.getService(serviceType)).toBe(fun); | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.