mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
11ffb1ba6f
* feat: basic implements * feat: add rtl * feat: reorganize types * test: add test cases for capitalize * test: improve coverage * chore: improve types * chore: update * chore: update
18 lines
595 B
TypeScript
18 lines
595 B
TypeScript
import capitalize from '../capitalize';
|
|
|
|
describe('capitalize', () => {
|
|
it('should capitalize the first character of a string', () => {
|
|
expect(capitalize('antd')).toBe('Antd');
|
|
expect(capitalize('Antd')).toBe('Antd');
|
|
expect(capitalize(' antd')).toBe(' antd');
|
|
expect(capitalize('')).toBe('');
|
|
});
|
|
|
|
it('should return the original value when is not a string', () => {
|
|
expect(capitalize(1 as any)).toBe(1);
|
|
expect(capitalize(true as any)).toBe(true);
|
|
expect(capitalize(undefined as any)).toBe(undefined);
|
|
expect(capitalize(null as any)).toBe(null);
|
|
});
|
|
});
|