X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/72b6c853b95b1ef3da2a0beca3a31e4838a17896..cda10815df30e3bceec728535f426754ef8ff2e8:/src/store/search-bar/search-bar-actions.test.ts diff --git a/src/store/search-bar/search-bar-actions.test.ts b/src/store/search-bar/search-bar-actions.test.ts index 48dfeecfe5..aa6e4759e0 100644 --- a/src/store/search-bar/search-bar-actions.test.ts +++ b/src/store/search-bar/search-bar-actions.test.ts @@ -2,15 +2,15 @@ // // SPDX-License-Identifier: AGPL-3.0 -import { getAdvancedDataFromQuery, getQueryFromAdvancedData, parseQuery } from "~/store/search-bar/search-bar-actions"; +import { getAdvancedDataFromQuery, getQueryFromAdvancedData, parseSearchQuery } from "~/store/search-bar/search-bar-actions"; import { ResourceKind } from "~/models/resource"; import { ClusterObjectType } from "~/models/search-bar"; describe('search-bar-actions', () => { - describe('parseQuery', () => { + describe('parseSearchQuery', () => { it('should correctly parse query #1', () => { const q = 'val0 is:trashed val1'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val1']); expect(r.properties).toEqual({ @@ -20,7 +20,7 @@ describe('search-bar-actions', () => { it('should correctly parse query #2 (value with keyword should be ignored)', () => { const q = 'val0 is:from:trashed val1'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val1']); expect(r.properties).toEqual({ @@ -30,7 +30,7 @@ describe('search-bar-actions', () => { it('should correctly parse query #3 (many keywords)', () => { const q = 'val0 is:trashed val2 from:2017-04-01 val1'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val2', 'val1']); expect(r.properties).toEqual({ @@ -41,7 +41,7 @@ describe('search-bar-actions', () => { it('should correctly parse query #4 (no duplicated values)', () => { const q = 'val0 is:trashed val2 val2 val0'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val2']); expect(r.properties).toEqual({ @@ -51,7 +51,7 @@ describe('search-bar-actions', () => { it('should correctly parse query #5 (properties)', () => { const q = 'val0 has:filesize:100mb val2 val2 val0'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val2']); expect(r.properties).toEqual({ @@ -61,7 +61,7 @@ describe('search-bar-actions', () => { it('should correctly parse query #6 (multiple properties, multiple is)', () => { const q = 'val0 has:filesize:100mb val2 has:user:daniel is:starred val2 val0 is:trashed'; - const r = parseQuery(q); + const r = parseSearchQuery(q); expect(r.hasKeywords).toBeTruthy(); expect(r.values).toEqual(['val0', 'val2']); expect(r.properties).toEqual({ @@ -91,7 +91,7 @@ describe('search-bar-actions', () => { }], saveQuery: false, queryName: '' - }) + }); }); it('should correctly build advanced data record from query #2', () => { @@ -110,7 +110,7 @@ describe('search-bar-actions', () => { }], saveQuery: false, queryName: '' - }) + }); }); }); @@ -132,6 +132,6 @@ describe('search-bar-actions', () => { queryName: '' }); expect(q).toBe('document pdf type:arvados#collection cluster:indianapolis is:trashed from:2017-08-01 has:filesize:101mb'); - }) + }); }); });