diff options
Diffstat (limited to 'test/networking/NetworkUtil.test.js')
-rw-r--r-- | test/networking/NetworkUtil.test.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/networking/NetworkUtil.test.js b/test/networking/NetworkUtil.test.js new file mode 100644 index 0000000..1743813 --- /dev/null +++ b/test/networking/NetworkUtil.test.js @@ -0,0 +1,22 @@ +import {getTSUIElasticSearchQueryString} from 'app/networking/NetworkUtil'; + +describe("Network Utils", () => { + describe('#getTSUIElasticSearchQueryString', () => { + it('should return query body', () => { + const query = "query"; + const response = getTSUIElasticSearchQueryString(query); + expect(response).toEqual({"maxResults": "10", "queryStr": "query"}); + }); + + it('should return partial request query', () => { + const query = ""; + const response = getTSUIElasticSearchQueryString(query); + expect(response).toEqual({"maxResults": "10", "queryStr": ""}); + }); + + it('should be truthy', () => { + const query = ""; + expect(getTSUIElasticSearchQueryString(query)).toBeTruthy(); + }) + }); +}); |