mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 16:38:50 +02:00
add test ids for casper tests
This commit is contained in:
parent
e519ff281b
commit
a998e5870d
2 changed files with 15 additions and 2 deletions
|
@ -22,12 +22,12 @@ var HelperBarView = React.createClass({
|
||||||
<div className={topClassName}>
|
<div className={topClassName}>
|
||||||
{this.props.items.map(function(item, index) {
|
{this.props.items.map(function(item, index) {
|
||||||
return [
|
return [
|
||||||
this.renderItem(item),
|
this.renderItem(item, index),
|
||||||
// ugh -- we need this spacer at the end only
|
// ugh -- we need this spacer at the end only
|
||||||
// if we are not the last element
|
// if we are not the last element
|
||||||
index === this.props.items.length - 1 ?
|
index === this.props.items.length - 1 ?
|
||||||
null :
|
null :
|
||||||
<span key={'helper_bar_' + index}>{' '}</span>
|
<span key={'helper_bar_span_' + index}>{' '}</span>
|
||||||
];
|
];
|
||||||
}.bind(this))}
|
}.bind(this))}
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,9 +35,12 @@ var HelperBarView = React.createClass({
|
||||||
},
|
},
|
||||||
|
|
||||||
renderItem: function(item, index) {
|
renderItem: function(item, index) {
|
||||||
|
var testID = item.icon || item.testID ||
|
||||||
|
item.text.toLowerCase();
|
||||||
if (item.newPageLink) {
|
if (item.newPageLink) {
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
|
data-testid={testID}
|
||||||
key={'helper_bar_' + index}
|
key={'helper_bar_' + index}
|
||||||
onClick={item.onClick}
|
onClick={item.onClick}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -49,6 +52,7 @@ var HelperBarView = React.createClass({
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
|
data-testid={testID}
|
||||||
key={'helper_bar_' + index}
|
key={'helper_bar_' + index}
|
||||||
onClick={item.onClick}>
|
onClick={item.onClick}>
|
||||||
{item.text ? item.text :
|
{item.text ? item.text :
|
||||||
|
|
|
@ -29,46 +29,55 @@ var IntlHelperBarView = React.createClass({
|
||||||
getItems: function() {
|
getItems: function() {
|
||||||
return [{
|
return [{
|
||||||
text: 'Git Branching',
|
text: 'Git Branching',
|
||||||
|
testID: 'english',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale en_US; levels');
|
this.fireCommand('locale en_US; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: '日本語版リポジトリ',
|
text: '日本語版リポジトリ',
|
||||||
|
testID: 'japanese',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale ja; levels');
|
this.fireCommand('locale ja; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: 'Git 브랜치 배우기',
|
text: 'Git 브랜치 배우기',
|
||||||
|
testID: 'korean',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale ko; levels');
|
this.fireCommand('locale ko; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: '学习 Git 分支',
|
text: '学习 Git 分支',
|
||||||
|
testID: 'simplifiedChinese',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale zh_CN; levels');
|
this.fireCommand('locale zh_CN; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: '學習 Git 分支',
|
text: '學習 Git 分支',
|
||||||
|
testID: 'traditionalChinese',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale zh_TW; levels');
|
this.fireCommand('locale zh_TW; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: 'español',
|
text: 'español',
|
||||||
|
testID: 'spanish',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale es_AR; levels');
|
this.fireCommand('locale es_AR; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: 'português',
|
text: 'português',
|
||||||
|
testID: 'portuguese',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale pt_BR; levels');
|
this.fireCommand('locale pt_BR; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: 'français',
|
text: 'français',
|
||||||
|
testID: 'french',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale fr_FR; levels');
|
this.fireCommand('locale fr_FR; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
}, {
|
}, {
|
||||||
text: 'Deutsch',
|
text: 'Deutsch',
|
||||||
|
testID: 'german',
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
this.fireCommand('locale de_DE; levels');
|
this.fireCommand('locale de_DE; levels');
|
||||||
}.bind(this)
|
}.bind(this)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue