Fixing cancel ids for selenium (#5896)

* Fixing ids for selenium

* Fixing ids

* Fixing prop
Этот коммит содержится в:
Corey Hulen
2017-03-27 18:12:24 -07:00
коммит произвёл GitHub
родитель 022627f940
Коммит ca8b8d1245
3 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@@ -31,11 +31,19 @@ export function isMac() {
return navigator.platform.toUpperCase().indexOf('MAC') >= 0;
}
export function createSafeId(str) {
if (str === null) {
export function createSafeId(prop) {
if (prop === null) {
return null;
}
var str = '';
if (prop.props && prop.props.defaultMessage) {
str = prop.props.defaultMessage;
} else {
str = prop.toString();
}
return str.replace(new RegExp(' ', 'g'), '_');
}