-
Notifications
You must be signed in to change notification settings - Fork 7
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
#356 Database should be connected to Profile Page #367
Closed
Conversation
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
…ounts interface" This reverts commit feeabb5. # Conflicts: # webapp/src/components/Profile.tsx
This WIP was done on #355 but we needed to close that ticket and merge it with main so it's going here instead.
This WIP was done on #355 but we needed to close that ticket and merge it with main so it's going here instead.
Add some function stubs into the appropriate files so it's easier to break down the task ahead to be able to process changes to an IUserData object.
…thub.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
… '356-Database-should-be-connected-to-Profile-Page' of github.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
…thub.com:OpenTree-Education/rhizone-lms into 356-Database-should-be-connected-to-Profile-Page
WIP commit so I can switch machines.
With the addition of the logic for comparing social profiles, we can now fully compare two IUserData objects. This should finalize the work on the issue for now. However, the logic has not been tested.
In the case of a modified object, we were returning the modified object back to the user, re-generated. In the case of the unmodified object, we were returning an empty response. I'm modifying that second behavior to instead return the object, for consistency's sake.
This is to conform to the Entity interface in the web app, but also, it makes more sense when working with the principals table.
Let's clean things up by capitalizing the social networks.
I finally got a chance to test the HTTP PUT for the full_name at least and our implementation was surprisingly close to working for having worked late into yesterday night. Some minor fixes were needed to get it to behave (almost) as expected.
Before addressing the failing tests, let's make sure `yarn delint` is run.
There's more work to be done here in coverage, but all tests are now passing.
We're mocking and catching console.log but we also should be mocking console.error.
Suppresses warning message from Jest letting us know that our caniuse-lite database is out of date.
Files committed are to support the completion of the `getUserProfileDataService.ts` test.
Since we're parsing input that could be any type, we need the any type here. Better to be explicit about it.
We had a 401 error defined but not a 403 error defined. This commit adds the 403 and changes the 401 message to differentiate it more clearly.
Changes in this commit were to add full coverage for all tests in the middleware directory as well as changes to any other files to be able to support or pass these tests.
Only show non-public social networks if we're authenticated as the user being queried.
if user chooses to hide email address, make sure we blank out the email address field in the IUserData object unless it's our own profile.
I really wanted to comment out the errors from having Jest test them, but that would cause us not to hit 100%. So, let's simulate an error being encountered during a transaction, as unlikely as that would be.
We're not done, of course. But this marks the first time in a while that all Jest tests have passed.
There is now a test for all API code.
Pre-populate the principals table with full_name, avatar_url, and bio from GitHub.
seidior
changed the title
[Testing] Making sure the server can run tests again.
#356 Database should be connected to Profile Page
Jun 10, 2022
The last commit caused an error with testing. This is now fixed.
2 tasks
This reverts commit 59f2f44 to ensure this branch only contains changes to the api/ subdirectory and not any changes to the webapp/ subdirectory. The changes from that commit will be migrated over to the appropriate branch.
2 tasks
This reverts commit 69e4559, which was done to suppress the warnings from Jest about the caniuse-lite database being out of date. With the lock file unchanged, the PR for this branch will not require the review by production engineers.
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.
Proposed changes
This pull request allows the API to deliver well-formed profile data to the profile component in the web app as well as allowing the API to receive and correctly parse edited profile data being sent back to it from the web app. This fully resolves issue #356.
This also resolves issue #366 by back-filling all the missing Jest tests for the API which causes all automated tests for the repository to pass.
Checklist