-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation for user comment notification #54
base: develop
Are you sure you want to change the base?
Conversation
|
||
it('it should call next function for server error', ()=>{ | ||
sinon.stub(NotificationRepository, 'getAll').throws(); | ||
expect(CommentNotificationController.create).throws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
NotificationRepository.getAll.restore(); | ||
}); | ||
|
||
it('it should call next function for server error', ()=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after => arrow-spacing
Missing space before => arrow-spacing
expect(res.write).to.be.calledWith('\n'); | ||
}); | ||
|
||
it('it should return unread comments', ()=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines padded-blocks
Missing space after => arrow-spacing
Missing space before => arrow-spacing
|
||
after(()=>{ sinon.restore(); }); | ||
|
||
it('it should set headers should be set', ()=>{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after => arrow-spacing
Missing space before => arrow-spacing
sinon.spy(res, 'write'); | ||
}); | ||
|
||
after(()=>{ sinon.restore(); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space after => arrow-spacing
Missing space before => arrow-spacing
import chai, { expect } from 'chai'; | ||
import chaiHttp from 'chai-http'; | ||
import CommentNotificationController from '../src/controllers/CommentNotificationController'; | ||
import {req, res, next} from './mock.data'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space is required after '{' object-curly-spacing
A space is required before '}' object-curly-spacing
@@ -1,18 +1,11 @@ | |||
import { Router } from 'express'; | |||
|
|||
import userNotificationController from '../controllers/ExampleUserNotificationController'; | |||
import authenticateUser from '../middlewares/authenticateUser' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon semi
}, | ||
|
||
down: (queryInterface, Sequelize) => { | ||
return queryInterface.bulkDelete('Notifications', null, {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 4 spaces but found 6 indent
return queryInterface.bulkInsert('Notifications', notificationData, {}); | ||
}, | ||
|
||
down: (queryInterface, Sequelize) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Sequelize' is defined but never used no-unused-vars
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>
arrow-body-style
'use strict'; | ||
|
||
module.exports = { | ||
up: (queryInterface, Sequelize) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Sequelize' is defined but never used no-unused-vars
Implementation of user comment notification. Users should receive comment notification when comments are created on thier trip request. Finished[167728039]
8312dfa
to
8d2ab58
Compare
What does this PR do?
Implementation for users to receive comment notifications trips request on a realtime base.
Description of Task to be completed?
Users of the platform should be able to receive comment notification on their trip request.
When a comment is posted to a request, the requester’s would receive a summary of the comment and a link to view the given trip request.
How should this be manually tested?
clone [email protected]:andela/cyclops-backend.git
eventSource
to listen tohttp://localhost:3000/api/v1/notifications/comment?slt=${token}
, including the token of the user in{token}
/trips POST
request and enter the parameters:request_type: {"oneWayTrip" or "returnTrip"}
trip_plan: {"singleCity" or "multiCity"}
leaving_from: {valid uuid of office"}
return_date
travel_date"
destination
/comment/trips
to make comment providing:request_uuid: {valid uuid of a trip you created"}
message
Any background context you want to provide?
EventSouce API
needs to be set up in the frontend to listen to new comments.The frontend auto-reconnects in the face of a server error.
What are the relevant stories?
#167728039
Screenshots (if appropriate)
Questions:
none