1import { getAlignmentOptionsByMetric } from './functions';
2import { ValueTypes, MetricKind } from './types';
3
4describe('functions', () => {
5  let result: any;
6  describe('getAlignmentOptionsByMetric', () => {
7    describe('when double and gauge is passed', () => {
8      beforeEach(() => {
9        result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.GAUGE);
10      });
11
12      it('should return all alignment options except two', () => {
13        expect(result.length).toBe(9);
14        expect(result.map((o: any) => o.value)).toEqual(
15          expect.not.arrayContaining(['REDUCE_COUNT_TRUE', 'REDUCE_COUNT_FALSE'])
16        );
17      });
18    });
19
20    describe('when double and delta is passed', () => {
21      beforeEach(() => {
22        result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.DELTA);
23      });
24
25      it('should return all alignment options except four', () => {
26        expect(result.length).toBe(9);
27        expect(result.map((o: any) => o.value)).toEqual(
28          expect.not.arrayContaining([
29            'ALIGN_COUNT_TRUE',
30            'ALIGN_COUNT_FALSE',
31            'ALIGN_FRACTION_TRUE',
32            'ALIGN_INTERPOLATE',
33          ])
34        );
35      });
36    });
37  });
38});
39