twenty / packages /twenty-shared /src /utils /strings /__tests__ /pascalToKebab.test.ts
Jules
Initial clean CRM deployment with prebuilt assets
d9494a5
Raw
History Blame Contribute Delete
796 Bytes
import { pascalToKebab } from '../pascalToKebab';
describe('pascalToKebab', () => {
it('should convert PascalCase to kebab-case', () => {
expect(pascalToKebab('UserProfile')).toBe('user-profile');
});
it('should convert single word', () => {
expect(pascalToKebab('Button')).toBe('button');
});
it('should handle consecutive uppercase letters', () => {
expect(pascalToKebab('HTMLElement')).toBe('html-element');
});
it('should handle numbers in the name', () => {
expect(pascalToKebab('H1Title')).toBe('h1-title');
});
it('should handle multi-word PascalCase', () => {
expect(pascalToKebab('MyComponentName')).toBe('my-component-name');
});
it('should handle already lowercase', () => {
expect(pascalToKebab('button')).toBe('button');
});
});