Skip to content

Commit e711c2a

Browse files
committed
add ui tests
1 parent f27b4e3 commit e711c2a

File tree

1 file changed

+116
-0
lines changed
  • redisinsight/ui/src/pages/workbench/utils/tests/test-cases

1 file changed

+116
-0
lines changed

redisinsight/ui/src/pages/workbench/utils/tests/test-cases/common.ts

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,120 @@ export const commonfindCurrentArgumentCases = [
226226
appendIncludes: ['TAGS', 'SUMMARIZE', 'DIALECT', 'FILTER', 'WITHSCORES', 'INKEYS'],
227227
appendNotIncludes: ['FIELDS'],
228228
},
229+
{
230+
input: 'FT.SEARCH index "*" SORTBY price ',
231+
result: expect.any(Object),
232+
appendIncludes: ['ASC', 'DESC', 'FILTER', 'LIMIT', 'DIALECT', 'WITHSCORES', 'INFIELDS'],
233+
appendNotIncludes: ['SORTBY'],
234+
},
235+
{
236+
input: 'FT.SEARCH textVehicles "(-@make:Toyota)" FILTER @year 2021 2022 ',
237+
result: expect.any(Object),
238+
appendIncludes: ['FILTER', 'GEOFILTER', 'TIMEOUT', 'WITHSORTKEYS'],
239+
appendNotIncludes: ['AS', 'ASC'],
240+
},
241+
{
242+
input: 'FT.SEARCH textVehicles "*" GEOFILTER geo_field lon lat radius ',
243+
result: expect.any(Object),
244+
appendIncludes: ['ft', 'km', 'm', 'mi'],
245+
appendNotIncludes: ['SORTBY', 'FILTER', 'LIMIT', 'DIALECT', 'AS', 'ASC'],
246+
},
247+
{
248+
input: 'FT.SEARCH textVehicles "*" RETURN 2 test ',
249+
result: expect.any(Object),
250+
appendIncludes: ['AS'],
251+
appendNotIncludes: ['SORTBY', 'FILTER', 'LIMIT', 'DIALECT', 'AS', 'ASC'],
252+
},
253+
{
254+
input: 'FT.CREATE textVehicles ON ',
255+
result: expect.any(Object),
256+
appendIncludes: ['HASH', 'JSON'],
257+
appendNotIncludes: ['SORTBY', 'FILTER', 'LIMIT', 'DIALECT', 'WITHSCORES', 'INFIELDS'],
258+
},
259+
{
260+
input: 'FT.CREATE textVehicles SCHEMA make ',
261+
result: expect.any(Object),
262+
appendIncludes: ['AS', 'GEO', 'NUMERIC', 'TAG', 'TEXT', 'VECTOR'],
263+
appendNotIncludes: ['FILTER', 'LIMIT', 'DIALECT', 'WITHSCORES', 'INFIELDS'],
264+
},
265+
{
266+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' APPLY \'test\' ',
267+
result: expect.any(Object),
268+
appendIncludes: ['AS'],
269+
appendNotIncludes: ['REDUCE', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
270+
},
271+
{
272+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' APPLY \'test\' AS test1',
273+
result: expect.any(Object),
274+
appendIncludes: ['APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
275+
},
276+
{
277+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' LOAD * ',
278+
result: expect.any(Object),
279+
appendIncludes: ['APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
280+
},
281+
{
282+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' SORTBY nargs property ',
283+
result: expect.any(Object),
284+
appendIncludes: ['ASC', 'DESC'],
285+
appendNotIncludes: ['REDUCE', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
286+
},
287+
{
288+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' SORTBY nargs property ASC ',
289+
result: expect.any(Object),
290+
appendIncludes: ['MAX', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
291+
},
292+
{
293+
input: 'FT.AGGREGATE \'idx:articles\' \'@body:(term) \' PARAMS 4 name1 value1 name2 value2 ',
294+
result: expect.any(Object),
295+
appendIncludes: ['APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
296+
appendNotIncludes: ['PARAMS', 'REDUCE'],
297+
},
298+
{
299+
input: 'FT.ALTER index SCHEMA ADD sdfsd fsdfsd ',
300+
result: expect.any(Object),
301+
appendIncludes: [],
302+
appendNotIncludes: ['SKIPINITIALSCAN', 'ADD', 'SCHEMA'],
303+
},
304+
{
305+
input: 'FT.DROPINDEX \'vd\' ',
306+
result: expect.any(Object),
307+
appendIncludes: ['DD'],
308+
},
309+
{
310+
input: 'FT.EXPLAIN index query ',
311+
result: expect.any(Object),
312+
appendIncludes: ['DIALECT'],
313+
appendNotIncludes: ['SKIPINITIALSCAN', 'ADD', 'SCHEMA', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
314+
},
315+
{
316+
input: 'FT.EXPLAINCLI index query ',
317+
result: expect.any(Object),
318+
appendIncludes: ['DIALECT'],
319+
appendNotIncludes: ['SKIPINITIALSCAN', 'ADD', 'SCHEMA', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
320+
},
321+
{
322+
input: 'FT.INFO index ',
323+
result: expect.any(Object),
324+
appendIncludes: [],
325+
appendNotIncludes: ['ADD', 'SCHEMA', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
326+
},
327+
{
328+
input: 'FT.PROFILE \'idx:schools\' ',
329+
result: expect.any(Object),
330+
appendIncludes: ['AGGREGATE', 'SEARCH'],
331+
appendNotIncludes: ['LIMITED'],
332+
},
333+
{
334+
input: 'FT.SPELLCHECK \'idx:articles\' \'test\' DIALECT dialect DISTANCE distance TERMS ',
335+
result: expect.any(Object),
336+
appendIncludes: ['EXCLUDE', 'INCLUDE'],
337+
appendNotIncludes: ['DIALECT', 'DISTANCE', 'TERMS'],
338+
},
339+
{
340+
input: 'FT.SYNUPDATE \'idx:products\' synonym_group_id ',
341+
result: expect.any(Object),
342+
appendIncludes: ['SKIPINITIALSCAN'],
343+
appendNotIncludes: ['DIALECT', 'DISTANCE', 'TERMS', 'INCLUDE', 'SCHEMA', 'APPLY', 'LOAD', 'SORTBY', 'GROUPBY'],
344+
},
229345
]

0 commit comments

Comments
 (0)