Passed
Push — master ( 3d88bb...696bd4 )
by Christian
21:06 queued 08:56
created

src/Administration/Resources/app/administration/test/core/data-new/criteria.data.spec.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 25
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 20
mnd 0
bc 0
fnc 3
dl 0
loc 25
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
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