-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * feature -creates Industries, Mentors and Mentees Table * --no-amend * user router created Co-authored-by: rui <[email protected]> * User Auth By Social Media * --no-amend * --no-amend * --no-amend * Added Db configuration and connection changes * --no-amend * --no-amend * --no-amend * Start adding passport local strategy Co-authored-by: Damola Adewunmi <[email protected]> Co-authored-by: Ikechukwu Eze <[email protected]> * Rename files and fix router to pass tests * ft/create-Mentoring_types-Pivot-Tables -created Mentoring_types, Mentees_choices Mentor_chioces Table -implemented many to many relationship between Mentor Mentee and Mentorying_types * --no-amend * local database connected * Deleted user-router file * --no-amend * --no-amend * --no-amend * Deleted UserAuth file * Deleted mentor test * --no-amend * refactored mentor file to use response helper * Created response helper * Added Create User profile endpoint * Commented out the as keyword from mentor and mentee choices * --no-amend * Added editUserProfile feature * Add bcrypt and add signup endpoint * --no-amend * added tests * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * refactored updateuserProfile * ft/seed-users-table added demo-user username password first_name last_name password and email * --no-amend * --no-amend * wrote some tests for update profile endpoint * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * --no-amend * added mentor controllers * Add OS specific exclusions Based on https://www.gitignore.io/api/linux,macos,windows * Added test for mentorRoute * commented out mentor test file * removed console.log * delete mentor test file * refactored code * Add login functionality and work on social auth * fixed some bugs on mentors and users endpoint * no-amend * Fix signup and login endpoints Co-authored-by: Nmeregini Vincent <[email protected]> * Add signup validator * Replace bcrypt with bcryptjs * Remove extra console.log * Remove console;log * fixed getUsers endpoint * turned sequelize scripts to use locally installed executables * Tested getallUsers endpoint * viewUserProfile fixed. bug * Test for viewUserProfile passed * Add comment to mentors controller * Add initial implementation of Github strategy Co-authored-by: Nmeregini Vincent <[email protected]> * Changed status codes * made changes as requested * damola changes * GetAllMentors debugged and tested * Add logout endpoint * no_amend * makeUserMentor feature debugged and fixed, tests implemented and passing * deleted comment as requested * All tests passed. Made changes as requested by Vincent * damola changes * Added condition to test * Complete github signup/login * Remove unused logout endpoint * Cleanup code * mentee routes written * Endpoints tested on Insomnia. Working as expected * Added standard tests for mentee endpoints * ft/mentoryinTypes-techName creates techJob table and seeds mentoryingType, techJob table * added niyon logo to mail * Made changes as requested by Rui * Made changes requested by Rui * getallJobs written and tested * Attach token to response when signing up * getMentoringTypes written * Refactored mentoringTypes * Add test * add autocomplete and corresponding tests * removed sum function in index * Remove bio requirement * removed test for unecessary sum function * ft/socialMedia -created social media Table -seeded social media Table -created endpoint to add a user's social media handle * skipped autocomplete test as it takes so much time * Fix bug on update profile endpoint * ft/socialMedia -created social media Table -seeded social media Table -created endpoint to add a user's social media handle * update user password endpoint * tests pass with new account * add more waiting time to image upload test * no-amend * skipped image upload test * update with development * wip * returns unique locations * removed babel-jest and resolved requested changes on the PR * Find or create location endpoint written * refined get user by username data * Made changes to test files * changed expected test result * no_amend * Made the changes as requested * no-amend * Changed validation on location model * Removed auth protection from locatiom route * modified the data that gets returned when fetching all users * Added some more endpoints * uncommented line * Refactored user profile update * made small changes * Made changes as requested by Rui * Fixed validation error on Location * Add Mentee and Mentor to getUserByUsername * Add Mentee and Mentor to getAllUsers * Change token expiration to 14 days
- Loading branch information
Showing
82 changed files
with
5,699 additions
and
667 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
service_name: circle-ci | ||
repo_token: a6qP3UeAT9QnLIDNtZkEjQuAjTz607lHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
commonjs: true, | ||
es6: true, | ||
node: true, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
config: path.resolve('./database/config', 'config.js'), | ||
'models-path': path.resolve('./database/models'), | ||
'seeders-path': path.resolve('./database/seeders'), | ||
'migrations-path': path.resolve('./database/migrations'), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{ | ||
"editor.formatOnSave": true | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const request = require('supertest'); | ||
const server = require('../server'); | ||
|
||
describe('Autocomplete /api/autocomplete/:place', () => { | ||
it('should return an array of possible location', async done => { | ||
try { | ||
const res = await request(server).get('/api/autocomplete/enugu'); | ||
expect(res.body.data.length).toBeGreaterThan(0); | ||
expect(res.status).toBe(200); | ||
done(); | ||
} catch (err) { | ||
done(`failed: ${JSON.stringify(err)}`); | ||
} | ||
}); | ||
it('should return an empty array for unknown location', async done => { | ||
try { | ||
const res = await request(server).get( | ||
'/api/autocomplete/xyrgvfggyeye633d' | ||
); | ||
expect(res.body.data).not.toBeUndefined(); | ||
expect(res.status).toBe(200); | ||
done(); | ||
} catch (err) { | ||
done(`failed: ${JSON.stringify(err)}`); | ||
} | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const request = require('supertest'); | ||
const server = require('../server'); | ||
|
||
describe('GET /api/countries/countries', () => { | ||
it('should return a 201 after getting all countries', () => { | ||
return request(server) | ||
.get('/api/countries/countries') | ||
.then(res => { | ||
expect(res.status).toBe(200); | ||
expect(res.body.data).toHaveLength(2); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('GET /api/countries/:country/cities', () => { | ||
it('should return a 200 if city exists', () => { | ||
return request(server) | ||
.get('/api/countries/Nigeria/cities') | ||
.then(res => { | ||
expect(res.status).toBe(200); | ||
expect(res.body.data).toHaveLength(2); | ||
}); | ||
}); | ||
|
||
it('should return a 200 if city dont exists', () => { | ||
return request(server) | ||
.get('/api/countries/canada/cities') | ||
.then(res => { | ||
expect(res.status).toBe(200); | ||
expect(res.body.data).toBe('No cities saved in the country'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const request = require('supertest'); | ||
const server = require('../server'); | ||
|
||
describe('Get /jobs/all', () => { | ||
it('should return a 200 code', async () => { | ||
return request(server) | ||
.get('/api/jobs/all') | ||
.then(res => { | ||
expect(res.status).toBe(200); | ||
expect(res.type).toEqual('application/json'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const request = require('supertest'); | ||
const server = require('../server'); | ||
|
||
describe('POST /api/location', () => { | ||
it('should return a 400 if country name is not provided', () => { | ||
return request(server) | ||
.post('/api/location/getLocation') | ||
.send({}) | ||
.then(res => { | ||
expect(res.status).toBe(400); | ||
expect(res.body.message.cityName[0]).toBe( | ||
'The cityName field is required.' | ||
); | ||
}); | ||
}); | ||
it('should return a 201 if location was created', () => { | ||
return request(server) | ||
.post('/api/location/getLocation') | ||
.send({ cityName: 'kaduna', countryName: 'Nigeria' }) | ||
.then(res => { | ||
expect(res.status).toBe(201); | ||
expect(res.body.data).toBe(3); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.