Upgraded/pruned deps, applied linting fixes

This commit is contained in:
Wyatt Johnson
2017-08-28 14:06:54 -06:00
parent a570626787
commit eb586f217b
93 changed files with 1758 additions and 1709 deletions
+6 -6
View File
@@ -25,9 +25,9 @@ describe('/api/v1/account/username', () => {
.set(passport.inject({id: '456', roles: ['ADMIN']}));
const res = await chai.request(app)
.put('/api/v1/account/username')
.set(passport.inject({id: mockUser.id, roles: []}))
.send({username: 'MojoJojo'});
.put('/api/v1/account/username')
.set(passport.inject({id: mockUser.id, roles: []}))
.send({username: 'MojoJojo'});
expect(res).to.have.status(204);
});
@@ -38,9 +38,9 @@ describe('/api/v1/account/username', () => {
.set(passport.inject({id: '456', roles: ['ADMIN']}));
let res = chai.request(app)
.put('/api/v1/account/username')
.set(passport.inject({id: 'wrongid', roles: []}))
.send({username: 'MojoJojo'});
.put('/api/v1/account/username')
.set(passport.inject({id: 'wrongid', roles: []}))
.send({username: 'MojoJojo'});
return expect(res).to.eventually.be.rejected;
});
+10 -13
View File
@@ -25,14 +25,11 @@ const SettingsService = require('../../../../../services/settings');
describe('/api/v1/auth/local', () => {
let mockUser;
beforeEach(() => {
beforeEach(async () => {
const settings = {requireEmailConfirmation: false, wordlist: {banned: ['bad'], suspect: ['naughty']}};
return SettingsService.init(settings).then(() => {
return UsersService.createLocalUser('maria@gmail.com', 'password!', 'Maria')
.then((user) => {
mockUser = user;
});
});
await SettingsService.init(settings);
mockUser = await UsersService.createLocalUser('maria@gmail.com', 'password!', 'Maria');
});
describe('email confirmation disabled', () => {
@@ -53,12 +50,12 @@ describe('/api/v1/auth/local', () => {
it('should not send back the user on a unsuccessful login', () => {
return chai.request(app)
.post('/api/v1/auth/local')
.send({email: 'maria@gmail.com', password: 'password!3'})
.catch((err) => {
expect(err).to.not.be.null;
expect(err.response).to.have.status(401);
expect(err.response.body).to.have.property('message', 'not authorized');
});
.send({email: 'maria@gmail.com', password: 'password!3'})
.catch((err) => {
expect(err).to.not.be.null;
expect(err.response).to.have.status(401);
expect(err.response.body).to.have.property('message', 'not authorized');
});
});
});
+9 -9
View File
@@ -20,9 +20,9 @@ describe('/api/v1/users/:user_id/email/confirm', () => {
beforeEach(() => SettingsService.init(settings).then(() => {
return UsersService.createLocalUser('ana@gmail.com', '123321123', 'Ana');
})
.then((user) => {
mockUser = user;
}));
.then((user) => {
mockUser = user;
}));
describe('#post', () => {
it('should send an email when we hit the endpoint', () => {
@@ -56,9 +56,9 @@ describe('/api/v1/users/:user_id/actions', () => {
beforeEach(() => SettingsService.init(settings).then(() => {
return UsersService.createLocalUser('ana@gmail.com', '123321123', 'Ana');
})
.then((user) => {
mockUser = user;
}));
.then((user) => {
mockUser = user;
}));
describe('#post', () => {
it('it should update actions', () => {
@@ -82,9 +82,9 @@ describe('/api/v1/users/:user_id/username-enable', () => {
beforeEach(() => SettingsService.init(settings).then(() => {
return UsersService.createLocalUser('ana@gmail.com', '123321123', 'Ana');
})
.then((user) => {
mockUser = user;
}));
.then((user) => {
mockUser = user;
}));
describe('#post', () => {
it('it should enable a user to edit their username', () => {