mirror of
https://github.com/maputnik/editor.git
synced 2026-10-21 02:13:43 +00:00
Improve tests (#854)
Recover commented out tests, Improve usage of helper in driver, Added data-wd-key for test to use instead of classes Moved all non tsx file to a single folder (lib) instead of lib and utils --------- Co-authored-by: Yuri Astrakhan <yuriastrakhan@gmail.com>
This commit is contained in:
co-authored by
Yuri Astrakhan
parent
09a1f3f87b
commit
b784bf2b84
@@ -0,0 +1,13 @@
|
||||
import capitalize from 'lodash.capitalize'
|
||||
|
||||
export default function labelFromFieldName(fieldName: string) {
|
||||
let label;
|
||||
const parts = fieldName.split('-');
|
||||
if (parts.length > 1) {
|
||||
label = fieldName.split('-').slice(1).join(' ');
|
||||
}
|
||||
else {
|
||||
label = fieldName;
|
||||
}
|
||||
return capitalize(label);
|
||||
}
|
||||
Reference in New Issue
Block a user