-
Notifications
You must be signed in to change notification settings - Fork 8
feat: implement attendance preference for hackers. #773
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
Merged
Conversation
This file contains hidden or 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
Questions: - Do we need to write unit tests for this? - Do we need to update/regenerate api docs to reflect the change in response data for the hacker model.
- Drew JSON for testing from the api docs and was getting a validator error, on closer inspection, the spelling of acccommodation was incorrect in the docs, and in my own commit for hacker.validator.js.
- unit test the following failures: - invalid enum. - option not passed to the request. - add valid attendance preferences that vary across the dummy hackers.
fix: merge ci fixes and attendance preference changes.
pengyk
requested changes
Nov 28, 2021
| shirtSize: "L", | ||
| travel: 0, | ||
| // Attendence Preference Must Be Remote or In Person | ||
| // attendancePreference: "asdf" |
Member
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.
nit: i think these comments should be removed
| }); | ||
| }); | ||
|
|
||
| // should fail due to attendance preference not being passed in the request body. |
Member
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.
nit: uneven indent
logan-r
pushed a commit
that referenced
this pull request
Nov 29, 2021
* - Implement attendance preference for hackers. Questions: - Do we need to write unit tests for this? - Do we need to update/regenerate api docs to reflect the change in response data for the hacker model. * Fix spelling errors for accommodation in the codebase. - Drew JSON for testing from the api docs and was getting a validator error, on closer inspection, the spelling of acccommodation was incorrect in the docs, and in my own commit for hacker.validator.js. * feat: add unit testing for attendance preference. - unit test the following failures: - invalid enum. - option not passed to the request. - add valid attendance preferences that vary across the dummy hackers. * fix: remove accidental changes on valid test for code of conduct. * fix: add missing component on unit tests. * fix: add attendance preference field to remaining dummy hackers. * Potential fix to invalid input test Co-authored-by: Yun Kai Peng <yunkaipeng0129@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
List of Changes
hacker.model.jsto store their attendance preference.hacker.validator.js.Type of Change
Tests Run
Successful
POST /api/hackerRequest Body:
{ "accountId": "...", "application": { "general": { "school": "McGill University", "degree": "Undergraduate", "fieldOfStudy": ["Computer Science"], "graduationYear": "2021", "jobInterest": "Internship", "URL": { "resume": "resumes/1543458163426-5bff4d736f86be0a41badb91", "github": "https://github.com/abcd", "dropler": "https://dribbble.com/abcd", "personal": "https://www.hi.com/", "linkedIn": "https://linkedin.com/in/abcd", "other": "https://github.com/hackmcgill/hackerAPI/issues/168" } }, "shortAnswer": { "skills": [ "Javascript", "Typescript" ], "question1": "I love McHacks", "question2": "Pls accept me", "previousHackathons": 5, "comments": "hi!" }, "other": { "gender": "male", "ethnicity": ["Asian or Pacific Islander"], "privacyPolicy": true, "codeOfConduct": true }, "accommodation": { "travel": 0, "shirtSize": "XS", + "attendancePreference": "Remote" }, "location": { "timeZone": "GMT-5", "country": "Canada", "city": "Montreal" } } }Response Body:
{ "message": "Hacker creation successful.", "data": { "application": { "general": { "URL": { "resume": "resumes/1543458163426-5bff4d736f86be0a41badb91", "github": "https://github.com/abcd", "personal": "https://www.hi.com/", "linkedIn": "https://linkedin.com/in/abcd", "other": "https://github.com/hackmcgill/hackerAPI/issues/168" }, "fieldOfStudy": [ "Computer Science" ], "jobInterest": "Internship", "school": "McGill University", "degree": "Undergraduate", "graduationYear": 2021 }, "shortAnswer": { "skills": [ "Javascript", "Typescript" ], "comments": "hi!", "question1": "I love McHacks", "question2": "Pls accept me", "previousHackathons": 5 }, "other": { "ethnicity": [ "Asian or Pacific Islander" ], "privacyPolicy": true, "codeOfConduct": true }, "accommodation": { "impairments": "", "barriers": "", "travel": 0, "shirtSize": "XS", "attendancePreference": "Remote" }, "location": { "timeZone": "GMT-5", "country": "Canada", "city": "Montreal" } }, "status": "Applied", "accountId": "...", "id": "..." } }Failed
POST /api/hacker(Invalid Enum)Request Body:
{ "accountId": "...", "application": { "general": { "school": "McGill University", "degree": "Undergraduate", "fieldOfStudy": ["Computer Science"], "graduationYear": "2021", "jobInterest": "Internship", "URL": { "resume": "resumes/1543458163426-5bff4d736f86be0a41badb91", "github": "https://github.com/abcd", "dropler": "https://dribbble.com/abcd", "personal": "https://www.hi.com/", "linkedIn": "https://linkedin.com/in/abcd", "other": "https://github.com/hackmcgill/hackerAPI/issues/168" } }, "shortAnswer": { "skills": [ "Javascript", "Typescript" ], "question1": "I love McHacks", "question2": "Pls accept me", "previousHackathons": 5, "comments": "hi!" }, "other": { "gender": "male", "ethnicity": ["Asian or Pacific Islander"], "privacyPolicy": true, "codeOfConduct": true }, "accommodation": { "travel": 0, "shirtSize": "XS", - "attendancePreference": "ShouldError" }, "location": { "timeZone": "GMT-5", "country": "Canada", "city": "Montreal" } } }Response Body:
{ "message": "Validation failed", "data": { "application.accommodation.attendancePreference": { "value": "ShouldError", "msg": "The value must be part of the enum", "param": "application.accommodation.attendancePreference", "location": "body" } } }Failed
POST /api/hacker(Field Not Provided)Request Body:
{ "accountId": "...", "application": { "general": { "school": "McGill University", "degree": "Undergraduate", "fieldOfStudy": ["Computer Science"], "graduationYear": "2021", "jobInterest": "Internship", "URL": { "resume": "resumes/1543458163426-5bff4d736f86be0a41badb91", "github": "https://github.com/abcd", "dropler": "https://dribbble.com/abcd", "personal": "https://www.hi.com/", "linkedIn": "https://linkedin.com/in/abcd", "other": "https://github.com/hackmcgill/hackerAPI/issues/168" } }, "shortAnswer": { "skills": [ "Javascript", "Typescript" ], "question1": "I love McHacks", "question2": "Pls accept me", "previousHackathons": 5, "comments": "hi!" }, "other": { "gender": "male", "ethnicity": ["Asian or Pacific Islander"], "privacyPolicy": true, "codeOfConduct": true }, "accommodation": { "travel": 0, "shirtSize": "XS" - }, "location": { "timeZone": "GMT-5", "country": "Canada", "city": "Montreal" } } }Response Body:
{ "message": "Validation failed", "data": { "application.accommodation.attendancePreference": { "msg": "The value being checked agains the enums must exist.", "param": "application.accommodation.attendancePreference", "location": "body" } } }Questions For Code Reviewers
api-docs.json.Checklist: