summaryrefslogtreecommitdiff
path: root/spec/frontend/lib/utils/common_utils_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/lib/utils/common_utils_spec.js')
-rw-r--r--spec/frontend/lib/utils/common_utils_spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/lib/utils/common_utils_spec.js b/spec/frontend/lib/utils/common_utils_spec.js
index de1be5bc337..3e2ba918d9b 100644
--- a/spec/frontend/lib/utils/common_utils_spec.js
+++ b/spec/frontend/lib/utils/common_utils_spec.js
@@ -1040,4 +1040,15 @@ describe('common_utils', () => {
expect(result).toEqual(['hello', 'helloWorld']);
});
});
+
+ describe('convertArrayOfObjectsToCamelCase', () => {
+ it('returns a new array with snake_case object property names converted camelCase', () => {
+ const result = commonUtils.convertArrayOfObjectsToCamelCase([
+ { hello: '' },
+ { hello_world: '' },
+ ]);
+
+ expect(result).toEqual([{ hello: '' }, { helloWorld: '' }]);
+ });
+ });
});