| 
									
										
										
										
											2019-01-03 22:12:03 +08:00
										 |  |  | import { getAlignmentOptionsByMetric } from './functions'; | 
					
						
							|  |  |  | import { ValueTypes, MetricKind } from './constants'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('functions', () => { | 
					
						
							| 
									
										
										
										
											2019-06-27 21:56:02 +08:00
										 |  |  |   let result: any; | 
					
						
							| 
									
										
										
										
											2019-01-03 22:12:03 +08: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 21:56:02 +08:00
										 |  |  |         expect(result.map((o: any) => o.value)).toEqual( | 
					
						
							| 
									
										
										
										
											2019-01-03 22:12:03 +08: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 21:56:02 +08:00
										 |  |  |         expect(result.map((o: any) => o.value)).toEqual( | 
					
						
							| 
									
										
										
										
											2019-01-03 22:12:03 +08:00
										 |  |  |           expect.not.arrayContaining([ | 
					
						
							|  |  |  |             'ALIGN_COUNT_TRUE', | 
					
						
							|  |  |  |             'ALIGN_COUNT_FALSE', | 
					
						
							|  |  |  |             'ALIGN_FRACTION_TRUE', | 
					
						
							|  |  |  |             'ALIGN_INTERPOLATE', | 
					
						
							|  |  |  |           ]) | 
					
						
							|  |  |  |         ); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | }); |