summaryrefslogtreecommitdiffstats
path: root/test/app/networking/NetworkUtil.test.js
blob: 1743813aa50c285c6e5e0b4f03770ba5d696c9f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
    })
  });
});