Merge pull request #143 from pdehaan/develop-jshint
Cleaning up some JSHint errors Thanks @pdehaan! This looks good to me. I am working on another PR to fix up the `assertion_service.js`, but I wanna get @zaach's branch to fix up testing in general merged before submitting the code for that.
This commit is contained in:
Коммит
f53acffba5
|
@ -23,7 +23,9 @@ function(BaseView, SignInTemplate, gherkin, Session, Constants) {
|
|||
signIn: function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (! (this._validateEmail() && this._validatePassword())) return;
|
||||
if (! (this._validateEmail() && this._validatePassword())) {
|
||||
return;
|
||||
}
|
||||
|
||||
var email = this.$('.email').val();
|
||||
var password = this.$('.password').val();
|
||||
|
|
|
@ -23,7 +23,9 @@ function(BaseView, SignUpTemplate, gherkin, Session, Constants) {
|
|||
signUp: function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (! (this._validateEmail() && this._validatePassword())) return;
|
||||
if (! (this._validateEmail() && this._validatePassword())) {
|
||||
return;
|
||||
}
|
||||
|
||||
var email = this.$('.email').val();
|
||||
var password = this.$('.password').val();
|
||||
|
|
|
@ -5,4 +5,6 @@
|
|||
define([
|
||||
'./functional/login',
|
||||
'./functional/create_account'
|
||||
], function () {});
|
||||
], function () {
|
||||
'use strict';
|
||||
});
|
||||
|
|
|
@ -7,6 +7,8 @@ define([
|
|||
'intern/chai!assert',
|
||||
'require'
|
||||
], function (registerSuite, assert, require) {
|
||||
'use strict';
|
||||
|
||||
var url = 'http://localhost:3030/flow';
|
||||
//var email = 'some' + new Date().getTime() + '@example.com';
|
||||
|
||||
|
@ -47,7 +49,7 @@ define([
|
|||
.then(function (resultText) {
|
||||
assert.strictEqual(resultText, '', 'No errors in email creation');
|
||||
})
|
||||
.end()
|
||||
.end();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -7,6 +7,8 @@ define([
|
|||
'intern/chai!assert',
|
||||
'require'
|
||||
], function (registerSuite, assert, require) {
|
||||
'use strict';
|
||||
|
||||
var url = 'http://localhost:3030/flow';
|
||||
|
||||
registerSuite({
|
||||
|
@ -47,7 +49,7 @@ define([
|
|||
.then(function (text) {
|
||||
assert.strictEqual(text, 'Try another email or Create an account', 'Validates false login');
|
||||
})
|
||||
.end()
|
||||
.end();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -5,6 +5,7 @@
|
|||
define([
|
||||
'./intern'
|
||||
], function (intern) {
|
||||
'use strict';
|
||||
|
||||
intern.suites = [];
|
||||
intern.functionalSuites = [ 'tests/functional' ];
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
define([
|
||||
'./intern'
|
||||
], function (intern) {
|
||||
'use strict';
|
||||
|
||||
// simply override the main config file and adjust it to suite the local env
|
||||
|
||||
// disable Sauce Connect for local config
|
||||
|
|
|
@ -11,7 +11,6 @@ define([
|
|||
'intern/order!static/javascripts/vendor/bidbundle.js',
|
||||
'intern/order!static/javascripts/assertion_service.js'
|
||||
], function (tdd, assert, Deferred, request) {
|
||||
|
||||
with (tdd) {
|
||||
suite('assertion_service', function () {
|
||||
var client;
|
||||
|
@ -34,7 +33,7 @@ define([
|
|||
|
||||
return client.login();
|
||||
})
|
||||
.done(function (x) {
|
||||
.done(function () {
|
||||
|
||||
setupDfd.resolve();
|
||||
});
|
||||
|
@ -102,7 +101,7 @@ define([
|
|||
request
|
||||
.get(serverUrl + '/.well-known/browserid', {
|
||||
headers: {
|
||||
"X-Requested-With": ''
|
||||
'X-Requested-With': ''
|
||||
}
|
||||
})
|
||||
.then(
|
||||
|
@ -132,18 +131,21 @@ define([
|
|||
assert.ok(components.payload.iat, 'Issued date exists');
|
||||
assert.ok(components.payload.exp, 'Expire date exists');
|
||||
|
||||
if (typeof components.payload.iat !== 'number')
|
||||
if (typeof components.payload.iat !== 'number') {
|
||||
dfd.reject(new assert.AssertionError({ message: 'cert lacks an "issued at" (.iat) field' }));
|
||||
}
|
||||
|
||||
if (typeof components.payload.exp !== 'number')
|
||||
if (typeof components.payload.exp !== 'number') {
|
||||
dfd.reject(new assert.AssertionError({ message: 'cert lacks an "expires" (.exp) field' }));
|
||||
}
|
||||
|
||||
if (components.payload.exp < components.payload.iat)
|
||||
if (components.payload.exp < components.payload.iat) {
|
||||
dfd.reject(new assert.AssertionError({ message: 'assertion expires before cert is valid' }));
|
||||
}
|
||||
|
||||
if (components.payload.exp > (components.payload.exp + 5000))
|
||||
if (components.payload.exp > (components.payload.exp + 5000)) {
|
||||
dfd.reject(new assert.AssertionError({ message: 'assertion was likely issued after cert expired' }));
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
assertion: assertion,
|
||||
|
@ -156,7 +158,7 @@ define([
|
|||
},
|
||||
function (err) {
|
||||
dfd.reject();
|
||||
assert.fail(err, null, '.well-known request failed')
|
||||
assert.fail(err, null, '.well-known request failed');
|
||||
}
|
||||
)
|
||||
.then(
|
||||
|
@ -181,7 +183,7 @@ define([
|
|||
}
|
||||
);
|
||||
|
||||
return verifyDeferred.promise
|
||||
return verifyDeferred.promise;
|
||||
}
|
||||
)
|
||||
.then(
|
||||
|
@ -209,7 +211,7 @@ define([
|
|||
}
|
||||
});
|
||||
|
||||
return verifyBundleDeferred.promise
|
||||
return verifyBundleDeferred.promise;
|
||||
}
|
||||
).otherwise(function (error) { dfd.reject(error); });
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче