summaryrefslogtreecommitdiffstats
path: root/test/app/networking/NetworkUtil.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/app/networking/NetworkUtil.test.js')
-rw-r--r--test/app/networking/NetworkUtil.test.js22
1 files changed, 22 insertions, 0 deletions
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();
+ })
+ });
+});