asgardeo / asgardeo-auth-react-sdk

To maintain the implementation of Asgardeo React authentication SDK
Apache License 2.0
40 stars 91 forks source link

Added unit tests for APIs, Secure App and AuthContext hook #263

Open pranshustuff opened 3 weeks ago

pranshustuff commented 3 weeks ago

Purpose

Fixes #138

Goals

The tests automate unit test for pull requests so code isn't merged without making sure all the main parts of the code still function as intended.

Approach

I used Jest and React Testing library to mock various elements of the use cases and just made sure the functions returned the expected results.

brionmario commented 3 weeks ago

@pranshustuff Thanks a lot for this PR. I've added some comments.

Additionally, lets,

pranshustuff commented 3 weeks ago

I'm not really sure what you mean by "Send a follow up PR Test phase to the PR builder and the Release builder once"

pranshustuff commented 3 weeks ago

I'm sorry I made so many commits, I didn't realize it was to the main branch.

Anyway, everything works now. The only problem is that I made a pull request and there are no issues in my fork, so the notifications.yml ran into an error with the "send notification on issue creation". Which shouldn't be a problem on your side.

About the follow-up PR, I can't really create a new one since I've accidentally committed everything to this branch. I hope you see this comment. And I'll be waiting for feedback.

Hope to hear from you soon!