mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-12 07:49:01 +08:00
test: traceGraphFilter/utils selectedGroupByValue is added (#2201)
Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
This commit is contained in:
parent
d779b83715
commit
1151e8521e
27
frontend/src/container/Trace/TraceGraphFilter/utils.test.ts
Normal file
27
frontend/src/container/Trace/TraceGraphFilter/utils.test.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import { selectedGroupByValue } from './utils';
|
||||
|
||||
const options = [
|
||||
{
|
||||
value: '1',
|
||||
label: '1',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '2',
|
||||
},
|
||||
];
|
||||
|
||||
describe('TraceGraphFilter/utils', () => {
|
||||
it('should return the correct value', () => {
|
||||
const selectedGroupBy = '1';
|
||||
const result = selectedGroupByValue(selectedGroupBy, options);
|
||||
expect(result).toEqual(selectedGroupBy);
|
||||
});
|
||||
|
||||
it('should return the correct value when selectedOption not found', () => {
|
||||
const selectedGroupBy = '3';
|
||||
|
||||
const result = selectedGroupByValue(selectedGroupBy, options);
|
||||
expect(result).toEqual(selectedGroupBy);
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user