mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-13 13:48:26 +00:00
29 lines
834 B
TypeScript
29 lines
834 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|||
|
|
import { toKebabCase } from '../src/utils/toKebabCase';
|
||
|
|
|
||
|
|
describe('toKebabCase', () => {
|
||
|
|
it('should convert camelCase to kebab-case', () => {
|
||
|
|
expect(toKebabCase('camelCase')).toBe('camel-case');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('should convert PascalCase to kebab-case', () => {
|
||
|
|
expect(toKebabCase('PascalCase')).toBe('pascal-case');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('should handle strings with numbers', () => {
|
||
|
|
expect(toKebabCase('test123String')).toBe('test123-string');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('should handle already kebab-case strings', () => {
|
||
|
|
expect(toKebabCase('already-kebab-case')).toBe('already-kebab-case');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('should handle single lowercase word', () => {
|
||
|
|
expect(toKebabCase('word')).toBe('word');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('should handle empty string', () => {
|
||
|
|
expect(toKebabCase('')).toBe('');
|
||
|
|
});
|
||
|
|
});
|