Files
pterodactyl-panel/resources/scripts/lib/strings.spec.ts
T
6c0413e39b Start 2.0 development
Co-authored-by: Anthony <anthony@infraly.co>
Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
2026-10-05 18:10:18 -04:00

21 lines
763 B
TypeScript

import { describe, expect, it } from 'vitest';
import { capitalize } from '@/lib/strings';
describe('@/lib/strings.ts', function () {
describe('capitalize()', function () {
it('should capitalize a string', function () {
expect(capitalize('foo bar')).toBe('Foo bar');
expect(capitalize('FOOBAR')).toBe('FOOBAR');
});
it('should preserve the casing of the remaining characters', function () {
expect(capitalize('invalid CPU limit.')).toBe('Invalid CPU limit.');
expect(capitalize('the IPv4 address is invalid')).toBe('The IPv4 address is invalid');
});
it('should handle empty strings', function () {
expect(capitalize('')).toBe('');
});
});
});