Skip to content

feat: Display passing test cases for valid schemas #179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2025

Conversation

tanay-nagde
Copy link
Contributor

Feat: Display Passing Test Cases for Valid Schemas

What kind of change does this PR introduce?

  • Feature
  • Refactoring

Issue Number

Closes #69

Screenshots/videos

Screenshot of the updated output view showing the list of passed test cases:

Screenshot 2025-07-21 142941

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.ts
    Modified validateCode() to pass the testCaseResults to the reducer on successful validation, instead of discarding them.

  • reducers.ts
    Updated the outputReducer to correctly store the successful test results in the application state.

  • Output.tsx
    Adjusted the Output component to render the TestCasesWindow for valid schemas, displaying the list of all passed tests below the success message.

  • TestCaseWindow.tsx

    • Made the "Invalid Schema!" header conditional, so it only appears if there are actual failed tests.
    • Renamed the component from FailedTestCasesWindow to TestCasesWindow to 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.


Updates the output view to show passing test cases. Also applies automated formatting and lint fixes to the entire codebase.
@tanay-nagde
Copy link
Contributor Author

@JeelRajodiya please review my code .

@JeelRajodiya JeelRajodiya requested a review from Copilot August 16, 2025 14:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member

@tanay-nagde Great work! Thank you for your contributions!

@JeelRajodiya JeelRajodiya merged commit 2264644 into json-schema-org:main Aug 16, 2025
1 check passed
@tanay-nagde
Copy link
Contributor Author

@JeelRajodiya thanks for merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show passing (all) testcases when the user submits a correct schema
2 participants