developer-portal
developer-portal copied to clipboard
Complete and Enhance Verification API Tests
Linear Issue DEV-1070
What has been done
Complete and Enhance Verification API Tests
This pull request finalizes the verification API tests within /developer-portal/web/tests/api/verify.test.ts by filling in previously empty test cases and adjusting existing ones to improve coverage and relevance. Key updates include:
- Implementing a test for verifying staging proof and handling environment-specific behavior by setting
process.env.NODE_ENVto 'staging'. - Adding a test that checks the behavior when an invalid or inactive action is specified, properly responding with a 404 status and an
action_not_founderror code. - Modifying the test case for on-chain actions to ensure they are correctly identified and rejected with a 409 status, helping enforce the separation between off-chain and on-chain verification processes.
- Introducing validation for required parameters, specifically testing the scenario where a nullifier hash is missing, ensuring robust error handling with appropriate feedback.
- Addressing parameter parsing errors by including a test where invalid JSON body leads to a 400 status code and detailed error messages, enhancing API usability and developer experience.
- Adding a test to simulate and handle the scenario where a valid proof's nullifier cannot be inserted, ensuring the API gracefully handles backend inconsistencies or failures.
These changes aim to cover more operational scenarios and edge cases, thereby increasing the reliability and predictability of the verification API.
Changes summary
Files changed: 1 Files processed: 1
Changes were made successfully in 1 files
Changes were made successfully in 1 files