Skip to content

bookmarkcard.tsx and test.tsx file changed#336

Merged
R-Sandor merged 1 commit intoFindFirst-Development:mainfrom
eshant742:toasttest
Feb 13, 2025
Merged

bookmarkcard.tsx and test.tsx file changed#336
R-Sandor merged 1 commit intoFindFirst-Development:mainfrom
eshant742:toasttest

Conversation

@eshant742
Copy link
Contributor

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.

Copy link
Collaborator

@R-Sandor R-Sandor left a comment

Choose a reason for hiding this comment

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

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!

@R-Sandor R-Sandor merged commit 5b49edc into FindFirst-Development:main Feb 13, 2025
0 of 3 checks passed
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.

2 participants