bookmarkcard.tsx and test.tsx file changed#336
Merged
R-Sandor merged 1 commit intoFindFirst-Development:mainfrom Feb 13, 2025
Merged
bookmarkcard.tsx and test.tsx file changed#336R-Sandor merged 1 commit intoFindFirst-Development:mainfrom
R-Sandor merged 1 commit intoFindFirst-Development:mainfrom
Conversation
R-Sandor
approved these changes
Feb 13, 2025
Collaborator
R-Sandor
left a comment
There was a problem hiding this comment.
I pulled your code locally to test it and It looks so good, thank you!
The dedication to add the tests too. I know they are pain to write but they help me a lot as a maintainer so thank you!
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
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.
NewBookmarkCard.tsx
Success Toast Notification:
Added a green success toast notification using toast.success within the makeNewBookmark function. This notification is now displayed when a bookmark is added successfully, providing immediate visual feedback to the user.
Error Handling:
Retained the existing error toast for conflict errors (status code 409) so that users receive feedback in error cases.
newBookmarkCard.test.tsx
New Test for Success Toast:
Introduced a new unit test that simulates a successful bookmark addition. The test uses axios-mock-adapter to mock API responses and then asserts that the success toast message ("Bookmark added successfully!") appears in the document.
Validation of Changes:
The test ensures that upon form submission (with valid data), not only are the form fields reset as expected, but the green success toast notification is also rendered, confirming the new behavior.