2021-02-04 19:15:23 +01:00
|
|
|
import * as utils from './common.util';
|
2018-10-05 04:26:41 +02:00
|
|
|
|
2021-04-15 20:01:46 +02:00
|
|
|
describe('Common utils', () => {
|
|
|
|
describe('camelCaseToCapitalize', () => {
|
|
|
|
it('should return a capitalized string from a camel-cased string', () => {
|
2018-10-05 04:26:41 +02:00
|
|
|
const tests = [
|
2018-10-05 22:02:55 +02:00
|
|
|
{
|
2021-12-09 20:06:24 +01:00
|
|
|
input: undefined,
|
2018-10-05 22:02:55 +02:00
|
|
|
expected: '',
|
|
|
|
},
|
2018-10-05 04:26:41 +02:00
|
|
|
{
|
2021-12-09 20:06:24 +01:00
|
|
|
input: '',
|
2018-10-05 04:26:41 +02:00
|
|
|
expected: '',
|
|
|
|
},
|
|
|
|
{
|
2021-12-09 20:06:24 +01:00
|
|
|
input: 'thisIsATest',
|
2018-10-05 04:26:41 +02:00
|
|
|
expected: 'This Is A Test',
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
];
|
2018-10-05 04:26:41 +02:00
|
|
|
|
2021-12-09 20:06:24 +01:00
|
|
|
tests.forEach(({ input, expected }) => {
|
|
|
|
expect(utils.camelCaseToCapitalize(input)).toStrictEqual(expected);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|