Test authentication and authorization
Cover auth flows with tests for valid credentials, expired tokens, missing tokens, and permission denials. Uses mocks for JWT libraries and user stores.
Preview
Copy prompt
Write a complete test suite for the authentication and authorization logic in this [Language/Framework] application: [Paste the relevant code]. Cover the following scenarios: successful login with valid credentials, failed login with an incorrect password, requests with an expired access token, requests with a completely missing or malformed token, and attempts to access a resource by a user who lacks the required permission. Use mocks for the JWT library and user data store.
More
Testing
Prompts
