mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -21,12 +21,12 @@ const modulePath = require('path').join(
|
||||
)
|
||||
const _ = require('underscore')
|
||||
|
||||
describe('NotificationsHandler', function() {
|
||||
describe('NotificationsHandler', function () {
|
||||
const user_id = '123nd3ijdks'
|
||||
const notification_id = '123njdskj9jlk'
|
||||
const notificationUrl = 'notification.sharelatex.testing'
|
||||
|
||||
beforeEach(function() {
|
||||
beforeEach(function () {
|
||||
this.request = sinon.stub().callsArgWith(1)
|
||||
return (this.handler = SandboxedModule.require(modulePath, {
|
||||
requires: {
|
||||
@@ -38,8 +38,8 @@ describe('NotificationsHandler', function() {
|
||||
}))
|
||||
})
|
||||
|
||||
describe('getUserNotifications', function() {
|
||||
it('should get unread notifications', function(done) {
|
||||
describe('getUserNotifications', function () {
|
||||
it('should get unread notifications', function (done) {
|
||||
const stubbedNotifications = [{ _id: notification_id, user_id }]
|
||||
this.request.callsArgWith(
|
||||
1,
|
||||
@@ -63,7 +63,7 @@ describe('NotificationsHandler', function() {
|
||||
)
|
||||
})
|
||||
|
||||
it('should return empty arrays if there are no notifications', function() {
|
||||
it('should return empty arrays if there are no notifications', function () {
|
||||
this.request.callsArgWith(1, null, { statusCode: 200 }, null)
|
||||
return this.handler.getUserNotifications(
|
||||
user_id,
|
||||
@@ -74,12 +74,12 @@ describe('NotificationsHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('markAsRead', function() {
|
||||
beforeEach(function() {
|
||||
describe('markAsRead', function () {
|
||||
beforeEach(function () {
|
||||
return (this.key = 'some key here')
|
||||
})
|
||||
|
||||
it('should send a delete request when a delete has been received to mark a notification', function(done) {
|
||||
it('should send a delete request when a delete has been received to mark a notification', function (done) {
|
||||
return this.handler.markAsReadWithKey(user_id, this.key, () => {
|
||||
const opts = {
|
||||
uri: `${notificationUrl}/user/${user_id}`,
|
||||
@@ -95,15 +95,15 @@ describe('NotificationsHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('createNotification', function() {
|
||||
beforeEach(function() {
|
||||
describe('createNotification', function () {
|
||||
beforeEach(function () {
|
||||
this.key = 'some key here'
|
||||
this.messageOpts = { value: 12344 }
|
||||
this.templateKey = 'renderThisHtml'
|
||||
return (this.expiry = null)
|
||||
})
|
||||
|
||||
it('should post the message over', function(done) {
|
||||
it('should post the message over', function (done) {
|
||||
return this.handler.createNotification(
|
||||
user_id,
|
||||
this.key,
|
||||
@@ -126,15 +126,15 @@ describe('NotificationsHandler', function() {
|
||||
)
|
||||
})
|
||||
|
||||
describe('when expiry date is supplied', function() {
|
||||
beforeEach(function() {
|
||||
describe('when expiry date is supplied', function () {
|
||||
beforeEach(function () {
|
||||
this.key = 'some key here'
|
||||
this.messageOpts = { value: 12344 }
|
||||
this.templateKey = 'renderThisHtml'
|
||||
return (this.expiry = new Date())
|
||||
})
|
||||
|
||||
it('should post the message over with expiry field', function(done) {
|
||||
it('should post the message over with expiry field', function (done) {
|
||||
return this.handler.createNotification(
|
||||
user_id,
|
||||
this.key,
|
||||
@@ -160,12 +160,12 @@ describe('NotificationsHandler', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('markAsReadByKeyOnly', function() {
|
||||
beforeEach(function() {
|
||||
describe('markAsReadByKeyOnly', function () {
|
||||
beforeEach(function () {
|
||||
return (this.key = 'some key here')
|
||||
})
|
||||
|
||||
it('should send a delete request when a delete has been received to mark a notification', function(done) {
|
||||
it('should send a delete request when a delete has been received to mark a notification', function (done) {
|
||||
return this.handler.markAsReadByKeyOnly(this.key, () => {
|
||||
const opts = {
|
||||
uri: `${notificationUrl}/key/${this.key}`,
|
||||
|
||||
Reference in New Issue
Block a user