Skip to content
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

Feature 1124 user table #1142

Merged
merged 12 commits into from
Feb 29, 2024
Merged

Feature 1124 user table #1142

merged 12 commits into from
Feb 29, 2024

Conversation

ssh51117
Copy link
Collaborator

@ssh51117 ssh51117 commented Feb 27, 2024

# Updating User Table Endpoints and adding Unit Tests
Added create, get, and delete for UserTable in Dynamodb. Also added unit tests for all commands
Github Issue Number Here: <#1124>
What user problem are we solving?
There are no endpoints to hit the new UserTable in dynamodb
What solution does this PR provide?
Created the endpoints for all the commands. Also, created unit tests checking that the status codes returned are correct given certain responses from the table
Testing Methodology

How did you test your changes and verify that existing functionality is not broken
Used Postman to test the create, get, and delete functions. Ran unit tests to check for the correct status codes.
Screenshot of unit tests:

image Screen Recording of the functions working: https://youtu.be/-G3YUtXQBt8 **Any other considerations** using the create method with an already existing user_id will update the entry in the table. Also updated the handler export to turn it into a function instead of a constant, since the test was unable to import correctly when it was a constant. This did not break existing functionality in postman.

@ssh51117 ssh51117 requested a review from a team as a code owner February 27, 2024 22:39
@MugPand
Copy link
Contributor

MugPand commented Feb 28, 2024

The changes made in AppStack.test.ts verify the existence of the 3 user endpoints (POST, GET, DELETE), while the .test.ts files in serverless/packages/functions/src/user/tests validate the endpoint logic & responses from the individual endpoints. In the future, the same testing structure can be applied to newly created endpoints.

Copy link

sonarcloud bot commented Feb 28, 2024

Quality Gate Passed Quality Gate passed

Issues
13 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
1.7% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@alantao912 alantao912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MugPand MugPand added this pull request to the merge queue Feb 29, 2024
Merged via the queue into nextjs with commit 453d6e9 Feb 29, 2024
11 checks passed
@MugPand MugPand deleted the feature-1124-userTable branch February 29, 2024 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants