Files
frontend-app-authoring/src/editors/utils/camelizeKeys.test.js
Ben Warzeski 0f87a61639 feat: Select img api (#41)
* feat: add capabilities

* chore: more tests

* fix: use correct hook source for getDispatch

* fix: fix fetchImages data contract

* fix: make onClose method a callback for ImageUploadModal

* chore: lint and test updates

* chore: clean up propType warning

Co-authored-by: connorhaugh <chaugh21@amherst.edu>
2022-03-30 15:13:19 -04:00

33 lines
723 B
JavaScript

import { camelizeKeys } from './index';
const snakeCaseObject = {
some_attribute:
{
another_attribute: [
{ a_list: 'a lIsT' },
{ of_attributes: 'iN diFferent' },
{ different_cases: 'to Test' },
],
},
a_final_attribute: null,
a_last_one: undefined,
};
const camelCaseObject = {
someAttribute:
{
anotherAttribute: [
{ aList: 'a lIsT' },
{ ofAttributes: 'iN diFferent' },
{ differentCases: 'to Test' },
],
},
aFinalAttribute: null,
aLastOne: undefined,
};
describe('camelizeKeys', () => {
it('converts keys of objects to be camelCase', () => {
expect(camelizeKeys(snakeCaseObject)).toEqual(camelCaseObject);
});
});