twenty / packages /twenty-shared /src /utils /sentry /__tests__ /getGenericOperationName.test.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
674 Bytes
import { getGenericOperationName } from '@/utils/sentry/getGenericOperationName';
describe('getGenericOperationName', () => {
it('should extract the first word from a PascalCase name', () => {
expect(getGenericOperationName('FindOnePerson')).toBe('Find');
});
it('should extract the first word from another PascalCase name', () => {
expect(getGenericOperationName('AggregateCompanies')).toBe('Aggregate');
});
it('should return undefined for undefined input', () => {
expect(getGenericOperationName(undefined)).toBeUndefined();
});
it('should handle single word', () => {
expect(getGenericOperationName('Create')).toBe('Create');
});
});