Merge "Don't use lodash methods in tests where it's not required"

This commit is contained in:
Jenkins 2016-04-21 07:51:30 +00:00 committed by Gerrit Code Review
commit bc15921ecf
4 changed files with 7 additions and 7 deletions

View File

@ -301,7 +301,7 @@ _.defaults(Command.prototype, {
return new this.constructor(this, function() {
return this.parent
.waitForCssSelector(cssSelector, timeout)
.catch(_.constant(true))
.catch(() => true)
.assertElementExists(cssSelector, message);
});
},
@ -309,7 +309,7 @@ _.defaults(Command.prototype, {
return new this.constructor(this, function() {
return this.parent
.waitForCssSelector(cssSelector, timeout)
.catch(_.constant(true))
.catch(() => true)
.assertElementsExist(cssSelector, message);
});
},
@ -317,7 +317,7 @@ _.defaults(Command.prototype, {
return new this.constructor(this, function() {
return this.parent
.waitForElementDeletion(cssSelector, timeout)
.catch(_.constant(true))
.catch(() => true)
.assertElementNotExists(cssSelector, message);
});
},

View File

@ -120,7 +120,7 @@ ClusterPage.prototype = {
return this.remote
.then(() => this.goToTab(tabName))
.waitForCssSelector('div.tab-content div.row.changes-locked', 2000)
.then(_.constant(true), _.constant(false));
.then(() => true, () => false);
},
deployEnvironment() {
return this.remote

View File

@ -26,7 +26,7 @@ function ClustersPage(remote) {
ClustersPage.prototype = {
constructor: ClustersPage,
createCluster(clusterName, stepsMethods) {
var stepMethod = (stepName) => _.bind(_.get(stepsMethods, stepName, _.noop), this);
var stepMethod = (stepName) => _.get(stepsMethods, stepName, _.noop).bind(this);
return this.remote
.clickByCssSelector('.create-cluster')
.then(() => this.modal.waitToOpen())

View File

@ -34,7 +34,7 @@ InterfacesPage.prototype = {
(ifcDiv) => ifcDiv
.getVisibleText()
.then(
(currentIfcName) => _.trim(currentIfcName) === ifcName ? ifcElement : result
(currentIfcName) => currentIfcName.trim() === ifcName ? ifcElement : result
)
),
null
@ -116,7 +116,7 @@ InterfacesPage.prototype = {
(ifcNameElement) => ifcNameElement
.getVisibleText()
.then((name) => {
name = _.trim(name);
name = name.trim();
if (!_.contains(ifcsNames, name)) {
throw new Error('Unexpected name in bond: ' + name);
}