diff --git a/src/js/react_views/HelperBarView.jsx b/src/js/react_views/HelperBarView.jsx index 59b25134..7f1f4016 100644 --- a/src/js/react_views/HelperBarView.jsx +++ b/src/js/react_views/HelperBarView.jsx @@ -22,12 +22,12 @@ var HelperBarView = React.createClass({
{this.props.items.map(function(item, index) { return [ - this.renderItem(item), + this.renderItem(item, index), // ugh -- we need this spacer at the end only // if we are not the last element index === this.props.items.length - 1 ? null : - {' '} + {' '} ]; }.bind(this))}
@@ -35,9 +35,12 @@ var HelperBarView = React.createClass({ }, renderItem: function(item, index) { + var testID = item.icon || item.testID || + item.text.toLowerCase(); if (item.newPageLink) { return ( {item.text ? item.text : diff --git a/src/js/react_views/IntlHelperBarView.jsx b/src/js/react_views/IntlHelperBarView.jsx index c89b2131..6fa0c717 100644 --- a/src/js/react_views/IntlHelperBarView.jsx +++ b/src/js/react_views/IntlHelperBarView.jsx @@ -29,46 +29,55 @@ var IntlHelperBarView = React.createClass({ getItems: function() { return [{ text: 'Git Branching', + testID: 'english', onClick: function() { this.fireCommand('locale en_US; levels'); }.bind(this) }, { text: '日本語版リポジトリ', + testID: 'japanese', onClick: function() { this.fireCommand('locale ja; levels'); }.bind(this) }, { text: 'Git 브랜치 배우기', + testID: 'korean', onClick: function() { this.fireCommand('locale ko; levels'); }.bind(this) }, { text: '学习 Git 分支', + testID: 'simplifiedChinese', onClick: function() { this.fireCommand('locale zh_CN; levels'); }.bind(this) }, { text: '學習 Git 分支', + testID: 'traditionalChinese', onClick: function() { this.fireCommand('locale zh_TW; levels'); }.bind(this) }, { text: 'español', + testID: 'spanish', onClick: function() { this.fireCommand('locale es_AR; levels'); }.bind(this) }, { text: 'português', + testID: 'portuguese', onClick: function() { this.fireCommand('locale pt_BR; levels'); }.bind(this) }, { text: 'français', + testID: 'french', onClick: function() { this.fireCommand('locale fr_FR; levels'); }.bind(this) }, { text: 'Deutsch', + testID: 'german', onClick: function() { this.fireCommand('locale de_DE; levels'); }.bind(this)