Files
payload/src/utilities/formatLabels.spec.js
2020-11-30 14:36:08 -05:00

32 lines
734 B
JavaScript

import formatLabels from './formatLabels';
describe('formatLabels', () => {
it('should format singular slug', () => {
expect(formatLabels('word')).toMatchObject({
singular: 'Word',
plural: 'Words',
});
});
it('should format plural slug', () => {
expect(formatLabels('words')).toMatchObject({
singular: 'Word',
plural: 'Words',
});
});
it('should format kebab case', () => {
expect(formatLabels('my-slugs')).toMatchObject({
singular: 'My Slug',
plural: 'My Slugs',
});
});
it('should format camelCase', () => {
expect(formatLabels('camelCaseItems')).toMatchObject({
singular: 'Camel Case Item',
plural: 'Camel Case Items',
});
});
});