Skip to content

Commit

Permalink
frontend sync master gsoc (#169) (#191)
Browse files Browse the repository at this point in the history
* added update restrictions, techStacks in project and orgId to a user

* added edit restriction mechanism

* intial deactivation mechanism

* intial logging mechanism and deactive account

* issue fix

* fixing org creation issue

* Fixes issues in testing (#160)

* fix failing test file user.test.js

* fixes EADDRINUSE while testing

* fixes issues in prposal route

* fixed issues in org route and added new tests

* Moving Google Analytics requests to backend (#154)

* Moving Google Analytics requetss to backend

* Requested Changes

* Minor changes

* Adding code to prevent attacks (#153)

* modified user's api (#168)

* modified user's api

* login options during login

* Changes for reactions (#166)

Co-authored-by: Rupeshiya <[email protected]>
Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>

Co-authored-by: Devesh Verma <[email protected]>
Co-authored-by: Vaibhav D. Aren <[email protected]>
Co-authored-by: Kumar Saurabh Raj <[email protected]>
Co-authored-by: Asel Peiris <[email protected]>
Co-authored-by: pranjals149 <[email protected]>
  • Loading branch information
6 people authored Sep 13, 2020
1 parent 43ee99b commit 5a88381
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions test/user.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,38 @@ test('Should not update profile or unauthenticated user', async () => {
.expect(HttpStatus.UNAUTHORIZED)
})

/** Should update user profile */
test('Should update profile or authenticated user', async () => {
await request(app)
.patch('/user/me')
.set('Authorization', `Bearer ${testUser.tokens[0].token}`)
.send({
email: '[email protected]'
})
.expect(HttpStatus.OK)
})

/** Should fail to make updates that are not allowed to user profile */
test('Should be able to make only allowed updates to authenticated user', async () => {
await request(app)
.patch('/user/me')
.set('Authorization', `Bearer ${testUser.tokens[0].token}`)
.send({
gender: 'Male'
})
.expect(HttpStatus.BAD_REQUEST)
})

/** Should Fail updating profile of unauthenticate user */
test('Should not update profile or unauthenticated user', async () => {
await request(app)
.patch('/user/me')
.send({
email: '[email protected]'
})
.expect(HttpStatus.UNAUTHORIZED)
})

/** Delete authenticated user profile */
test('Should delete profile of authenticated user', async () => {
await request(app)
Expand Down

0 comments on commit 5a88381

Please sign in to comment.