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
|
|
|
{
|
|
|
|
test: undefined,
|
|
|
|
expected: '',
|
|
|
|
},
|
2018-10-05 04:26:41 +02:00
|
|
|
{
|
|
|
|
test: '',
|
|
|
|
expected: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
test: 'thisIsATest',
|
|
|
|
expected: 'This Is A Test',
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
];
|
2018-10-05 04:26:41 +02:00
|
|
|
|
|
|
|
tests.forEach(({ test, expected }) => {
|
2021-04-15 20:01:46 +02:00
|
|
|
expect(utils.camelCaseToCapitalize(test)).toStrictEqual(expected);
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|