1
|
|
|
import Criteria from 'src/core/data-new/criteria.data'; |
2
|
|
|
|
3
|
|
|
const types = [ |
4
|
|
|
{ type: 'avg', args: [] }, |
5
|
|
|
{ type: 'count', args: [] }, |
6
|
|
|
{ type: 'max', args: [] }, |
7
|
|
|
{ type: 'min', args: [] }, |
8
|
|
|
{ type: 'stats', args: [] }, |
9
|
|
|
{ type: 'sum', args: [] }, |
10
|
|
|
{ type: 'terms', args: [] }, |
11
|
|
|
{ type: 'filter', args: [] }, |
12
|
|
|
{ type: 'histogram', args: [] }, |
13
|
|
|
{ type: 'contains', args: [] }, |
14
|
|
|
{ type: 'equalsAny', args: ['field', []] }, |
15
|
|
|
{ type: 'range', args: [] }, |
16
|
|
|
{ type: 'equals', args: [] }, |
17
|
|
|
{ type: 'not', args: [] }, |
18
|
|
|
{ type: 'multi', args: [] } |
19
|
|
|
]; |
20
|
|
|
|
21
|
|
|
describe('criteria.data.js', () => { |
22
|
|
|
it('returns the correct aggregation and filter types', () => { |
23
|
|
|
types.forEach(el => expect(Criteria[el.type](...el.args).type).toEqual(el.type)); |
24
|
|
|
}); |
25
|
|
|
}); |
26
|
|
|
|