Merge branch 'master' into 142993479-tags

This commit is contained in:
Wyatt Johnson
2017-05-17 10:01:58 -06:00
150 changed files with 1038 additions and 1105 deletions
+2 -2
View File
@@ -204,7 +204,7 @@ describe('services.CommentsService', () => {
it('should return all comments if admin', () => {
return CommentsService
.findByUserId('456', true)
.then(comments => {
.then((comments) => {
expect(comments).to.have.length(4);
});
});
@@ -212,7 +212,7 @@ describe('services.CommentsService', () => {
it('should not return premod and rejected comments if not admin', () => {
return CommentsService
.findByUserId('456')
.then(comments => {
.then((comments) => {
expect(comments).to.have.length(1);
});
});
+3 -3
View File
@@ -7,13 +7,13 @@ describe('services.SettingsService', () => {
describe('#retrieve()', () => {
it('should have a moderation field defined', () => {
return SettingsService.retrieve().then(settings => {
return SettingsService.retrieve().then((settings) => {
expect(settings).to.have.property('moderation').and.to.equal('PRE');
});
});
it('should have two infoBox fields defined', () => {
return SettingsService.retrieve().then(settings => {
return SettingsService.retrieve().then((settings) => {
expect(settings).to.have.property('infoBoxEnable').and.to.equal(false);
expect(settings).to.have.property('infoBoxContent').and.to.equal('');
});
@@ -23,7 +23,7 @@ describe('services.SettingsService', () => {
describe('#update()', () => {
it('should update the settings with a passed object', () => {
const mockSettings = {moderation: 'POST', infoBoxEnable: true, infoBoxContent: 'yeah'};
return SettingsService.update(mockSettings).then(updatedSettings => {
return SettingsService.update(mockSettings).then((updatedSettings) => {
expect(updatedSettings).to.be.an('object');
expect(updatedSettings).to.have.property('moderation').and.to.equal('POST');
expect(updatedSettings).to.have.property('infoBoxEnable', true);
+2 -2
View File
@@ -173,12 +173,12 @@ describe('services.UsersService', () => {
it('should add user id to ignoredUsers set', async () => {
const user = mockUsers[0];
const usersToIgnore = [mockUsers[1], mockUsers[2]];
await UsersService.ignoreUsers(user.id, usersToIgnore.map(u => u.id));
await UsersService.ignoreUsers(user.id, usersToIgnore.map((u) => u.id));
const userAfterIgnoring = await UsersService.findById(user.id);
expect(userAfterIgnoring.ignoresUsers.length).to.equal(2);
// ignore same user another time, make sure it's not added to the list.
await UsersService.ignoreUsers(user.id, usersToIgnore.slice(0, 1).map(u => u.id));
await UsersService.ignoreUsers(user.id, usersToIgnore.slice(0, 1).map((u) => u.id));
const userAfterIgnoring2 = await UsersService.findById(user.id);
expect(userAfterIgnoring2.ignoresUsers.length).to.equal(2);
});