mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
21 lines
763 B
TypeScript
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('');
|
|
});
|
|
});
|
|
});
|