feat: Display passing test cases for valid schemas #179
Merged
JeelRajodiya merged 1 commit intojson-schema-org:mainfrom Aug 16, 2025
Merged
feat: Display passing test cases for valid schemas #179JeelRajodiya merged 1 commit intojson-schema-org:mainfrom
JeelRajodiya merged 1 commit intojson-schema-org:mainfrom
Conversation
Updates the output view to show passing test cases. Also applies automated formatting and lint fixes to the entire codebase.
Contributor
Author
|
@JeelRajodiya please review my code . |
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the user feedback mechanism by displaying all passing test cases when a user's schema is successfully validated, replacing the previous generic "Valid Schema!" message with detailed test results.
- Modified validation flow to pass test case results to the output reducer for successful validations
- Updated the output component to display test results for both valid and invalid schemas
- Renamed and refactored the test case window component to handle both success and failure scenarios
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/reducers.ts | Updated outputReducer to store test case results for valid schemas |
| lib/client-functions.ts | Modified validateCode to sort and pass test results on successful validation |
| app/components/TestCaseWindow/TestCaseWindow.tsx | Made error header conditional and renamed component to handle both scenarios |
| app/components/Output/Output.tsx | Added TestCasesWindow rendering for valid schemas and updated import |
| app/components/NavBarMenus/NavBarMenus.tsx | Removed empty line (formatting cleanup) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
JeelRajodiya
approved these changes
Aug 16, 2025
JeelRajodiya
approved these changes
Aug 16, 2025
Member
|
@tanay-nagde Great work! Thank you for your contributions! |
Contributor
Author
|
@JeelRajodiya thanks for merging. |
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.
Feat: Display Passing Test Cases for Valid Schemas
What kind of change does this PR introduce?
Issue Number
Closes #69
Screenshots/videos
Screenshot of the updated output view showing the list of passed test cases:
If relevant, did you update the documentation?
N/A
Summary
This change enhances the user feedback mechanism by displaying all passing test cases when a user's schema is successfully validated.
Previously, a correct submission only showed a generic
"Valid Schema!"message, hiding the details of the tests that were run. This update ensures that users can see a detailed breakdown of all the test cases they passed, providing better positive reinforcement and a more complete learning experience.Summary of Changes
client-function.tsModified
validateCode()to pass thetestCaseResultsto the reducer on successful validation, instead of discarding them.reducers.tsUpdated the
outputReducerto correctly store the successful test results in the application state.Output.tsxAdjusted the
Outputcomponent to render theTestCasesWindowfor valid schemas, displaying the list of all passed tests below the success message.TestCaseWindow.tsx"Invalid Schema!"header conditional, so it only appears if there are actual failed tests.FailedTestCasesWindowtoTestCasesWindowto better reflect its new role.Does this PR introduce a breaking change?
No — this PR updates the output view to show passing test cases.
It also applies automated formatting and lint fixes to the entire codebase.