X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fsparky-fe.git;a=blobdiff_plain;f=test%2Fapp%2Fnetworking%2FNetworkUtil.test.js;fp=test%2Fapp%2Fnetworking%2FNetworkUtil.test.js;h=1743813aa50c285c6e5e0b4f03770ba5d696c9f8;hp=0000000000000000000000000000000000000000;hb=b0f2f345cc2d1cc3812ad8a06fc1898daf5842d0;hpb=b2c7546f9027099161aeaf5791f1d0f3a52b92d2 diff --git a/test/app/networking/NetworkUtil.test.js b/test/app/networking/NetworkUtil.test.js new file mode 100644 index 0000000..1743813 --- /dev/null +++ b/test/app/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(); + }) + }); +});