Test: add edge case coverage for template upload and preview routes#427
Open
Arijit429 wants to merge 1 commit intofireform-core:mainfrom
Open
Test: add edge case coverage for template upload and preview routes#427Arijit429 wants to merge 1 commit intofireform-core:mainfrom
Arijit429 wants to merge 1 commit intofireform-core:mainfrom
Conversation
Author
|
Hi maintainers, extending my ongoing post-proposal testing roadmap, this PR adds negative-path coverage for the newly introduced template file routes to strengthen edge-case reliability and route safety. |
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.
Closes #24
🚀 Summary
This PR extends route-level integration coverage for the newly added template file endpoints by adding negative-path and edge-case test scenarios.
The focus is to improve regression safety and ensure the routes behave correctly under invalid inputs.
✨ What Changed
Extended:
with additional integration tests covering invalid request scenarios.
🧪 New Test Coverage Added
1) Non-PDF upload should fail
Validates that uploading unsupported file types correctly returns:
This ensures file type validation remains enforced.
2) Missing preview file should return 404
Verifies that requesting a non-existent PDF path correctly returns:
3) Outside-project file access should fail
Tests path validation and ensures attempts to preview files outside the project directory return:
This strengthens route safety and path validation behavior.
💡 Why This Helps
These tests improve:
This is especially important for file-based routes.
🧪 Local Validation
Executed locally using:
and verified successful execution of all added scenarios.
🎯 Impact
This improves production confidence for the newly introduced upload and preview endpoints by validating failure-path behavior in addition to happy-path flows.