[misc] fix prettier-eslint errors

This commit is contained in:
Jakob Ackermann 2020-02-11 10:08:35 +01:00
parent f901064a59
commit 00e15a383f
3 changed files with 40 additions and 31 deletions

View file

@ -124,7 +124,6 @@ module.exports = Notifications = {
return db.notifications.remove(searchOps, { justOne: true }, callback)
}
}
;['getUserNotifications', 'addNotification'].map(method =>
metrics.timeAsyncMethod(Notifications, method, 'mongo.Notifications', logger)
)

View file

@ -44,8 +44,8 @@ describe('Notifications Controller', function() {
])
})
describe('getUserNotifications', () =>
it('should ask the notifications for the users notifications', function(done) {
describe('getUserNotifications', function() {
return it('should ask the notifications for the users notifications', function(done) {
this.notifications.getUserNotifications = sinon
.stub()
.callsArgWith(1, null, this.stubbedNotification)
@ -63,10 +63,11 @@ describe('Notifications Controller', function() {
return done()
}
})
}))
})
})
describe('addNotification', () =>
it('should tell the notifications to add the notification for the user', function(done) {
describe('addNotification', function() {
return it('should tell the notifications to add the notification for the user', function(done) {
this.notifications.addNotification = sinon.stub().callsArgWith(2)
const req = {
params: {
@ -82,10 +83,11 @@ describe('Notifications Controller', function() {
return done()
}
})
}))
})
})
describe('removeNotificationId', () =>
it('should tell the notifications to mark the notification Id as read', function(done) {
describe('removeNotificationId', function() {
return it('should tell the notifications to mark the notification Id as read', function(done) {
this.notifications.removeNotificationId = sinon.stub().callsArgWith(2)
const req = {
params: {
@ -101,10 +103,11 @@ describe('Notifications Controller', function() {
return done()
}
})
}))
})
})
describe('removeNotificationKey', () =>
it('should tell the notifications to mark the notification Key as read', function(done) {
describe('removeNotificationKey', function() {
return it('should tell the notifications to mark the notification Key as read', function(done) {
this.notifications.removeNotificationKey = sinon.stub().callsArgWith(2)
const req = {
params: {
@ -120,10 +123,11 @@ describe('Notifications Controller', function() {
return done()
}
})
}))
})
})
return describe('removeNotificationByKeyOnly', () =>
it('should tell the notifications to mark the notification Key as read', function(done) {
return describe('removeNotificationByKeyOnly', function() {
return it('should tell the notifications to mark the notification Key as read', function(done) {
this.notifications.removeNotificationByKeyOnly = sinon
.stub()
.callsArgWith(1)
@ -140,5 +144,6 @@ describe('Notifications Controller', function() {
return done()
}
})
}))
})
})
})

View file

@ -71,8 +71,8 @@ describe('Notifications Tests', function() {
return (this.stubbedNotificationArray = [this.stubbedNotification])
})
describe('getUserNotifications', () =>
it('should find all notifications and return i', function(done) {
describe('getUserNotifications', function() {
return it('should find all notifications and return i', function(done) {
this.findStub.callsArgWith(1, null, this.stubbedNotificationArray)
return this.notifications.getUserNotifications(
user_id,
@ -85,7 +85,8 @@ describe('Notifications Tests', function() {
return done()
}
)
}))
})
})
describe('addNotification', function() {
beforeEach(function() {
@ -234,8 +235,8 @@ describe('Notifications Tests', function() {
})
})
describe('removeNotificationId', () =>
it('should mark the notification id as read', function(done) {
describe('removeNotificationId', function() {
return it('should mark the notification id as read', function(done) {
this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationId(
@ -254,10 +255,11 @@ describe('Notifications Tests', function() {
return done()
}
)
}))
})
})
describe('removeNotificationKey', () =>
it('should mark the notification key as read', function(done) {
describe('removeNotificationKey', function() {
return it('should mark the notification key as read', function(done) {
this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationKey(
@ -276,10 +278,11 @@ describe('Notifications Tests', function() {
return done()
}
)
}))
})
})
describe('removeNotificationByKeyOnly', () =>
it('should mark the notification key as read', function(done) {
describe('removeNotificationByKeyOnly', function() {
return it('should mark the notification key as read', function(done) {
this.updateStub.callsArgWith(2, null)
return this.notifications.removeNotificationByKeyOnly(
@ -292,10 +295,11 @@ describe('Notifications Tests', function() {
return done()
}
)
}))
})
})
return describe('deleteNotificationByKeyOnly', () =>
it('should completely remove the notification', function(done) {
return describe('deleteNotificationByKeyOnly', function() {
return it('should completely remove the notification', function(done) {
this.removeStub.callsArgWith(2, null)
return this.notifications.deleteNotificationByKeyOnly(
@ -308,5 +312,6 @@ describe('Notifications Tests', function() {
return done()
}
)
}))
})
})
})