test: traceGraphFilter/utils selectedGroupByValue is added (#2201)

Co-authored-by: Vishal Sharma <makeavish786@gmail.com>
This commit is contained in:
palashgdev 2023-02-08 12:58:53 +05:30 committed by GitHub
parent d779b83715
commit 1151e8521e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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);
});
});