twenty / packages /twenty-shared /src /utils /sentry /__tests__ /getHumanReadableNameFromCode.test.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
651 Bytes
import { getHumanReadableNameFromCode } from '@/utils/sentry/getHumanReadableNameFromCode';
describe('getHumanReadableNameFromCode', () => {
it('should convert snake_case to Title Case', () => {
expect(getHumanReadableNameFromCode('hello_world')).toBe('Hello World');
});
it('should handle single word', () => {
expect(getHumanReadableNameFromCode('hello')).toBe('Hello');
});
it('should handle uppercase code', () => {
expect(getHumanReadableNameFromCode('NOT_FOUND')).toBe('Not Found');
});
it('should handle multiple underscores', () => {
expect(getHumanReadableNameFromCode('a_b_c_d')).toBe('A B C D');
});
});