2019-01-03 15:12:03 +01:00
|
|
|
import { getAlignmentOptionsByMetric } from './functions';
|
2021-05-19 08:16:05 +02:00
|
|
|
import { ValueTypes, MetricKind } from './types';
|
2019-01-03 15:12:03 +01:00
|
|
|
|
|
|
|
|
describe('functions', () => {
|
2019-06-27 15:56:02 +02:00
|
|
|
let result: any;
|
2019-01-03 15:12:03 +01:00
|
|
|
describe('getAlignmentOptionsByMetric', () => {
|
|
|
|
|
describe('when double and gauge is passed', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.GAUGE);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should return all alignment options except two', () => {
|
|
|
|
|
expect(result.length).toBe(9);
|
2019-06-27 15:56:02 +02:00
|
|
|
expect(result.map((o: any) => o.value)).toEqual(
|
2019-01-03 15:12:03 +01:00
|
|
|
expect.not.arrayContaining(['REDUCE_COUNT_TRUE', 'REDUCE_COUNT_FALSE'])
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
describe('when double and delta is passed', () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
result = getAlignmentOptionsByMetric(ValueTypes.DOUBLE, MetricKind.DELTA);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should return all alignment options except four', () => {
|
|
|
|
|
expect(result.length).toBe(9);
|
2019-06-27 15:56:02 +02:00
|
|
|
expect(result.map((o: any) => o.value)).toEqual(
|
2019-01-03 15:12:03 +01:00
|
|
|
expect.not.arrayContaining([
|
|
|
|
|
'ALIGN_COUNT_TRUE',
|
|
|
|
|
'ALIGN_COUNT_FALSE',
|
|
|
|
|
'ALIGN_FRACTION_TRUE',
|
|
|
|
|
'ALIGN_INTERPOLATE',
|
|
|
|
|
])
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|