Skip to content

Display all passing test cases upon valid schema #155

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

techmannih
Copy link
Contributor

What kind of change does this PR introduce?
Display all passing test cases upon valid schema

Issue Number:

@techmannih
Copy link
Contributor Author

techmannih commented Mar 20, 2025

@JeelRajodiya JeelRajodiya requested a review from Copilot March 31, 2025 13:40
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 updates the display logic for test cases based on schema validity. It ensures that all test cases are marked as passed when a valid schema is provided and updates the UI accordingly.

  • Modified TestCasesWindow to support the isValidSchema prop and normalize test case results.
  • Updated Output to conditionally render the TestCasesWindow component and adjusted error handling.
  • Replaced unsafe DOM access in scroll functions with proper null checks and improved equality comparisons.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
app/components/TestCaseWindow/TestCaseWindow.tsx Updated component to display all passing test cases upon valid schema; improved safe access in scrolling and normalized test case results.
app/components/Output/Output.tsx Adjusted component to use the updated TestCasesWindow and improved error comparison and error message handling.
Comments suppressed due to low confidence (1)

app/components/TestCaseWindow/TestCaseWindow.tsx:58

  • [nitpick] The component name 'TestCasesWindow' does not match the file name 'TestCaseWindow.tsx'; consider renaming the file or component to maintain naming consistency.
export default function TestCasesWindow({

Copy link
Member

@JeelRajodiya JeelRajodiya left a comment

Choose a reason for hiding this comment

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

Great job for implementing the changes @techmannih! The feature is working as expected, but there is an edge case, which needs to be fixed.

Here is how you can reproduce the edge case:

  1. Validate a lesson
  2. Move to the next lesson
  3. Come back to the lesson,
  4. without modifying the code, hit validate, the code was saved in the editor so it is valid. but you will see the valid code message instead of all the test cases as passing. (view below gif for your reference)

input

@techmannih
Copy link
Contributor Author

@JeelRajodiya Correct, got your point! But this behavior was already there before the changes in this PR — meaning the last one doesn't reset even earlier. I think it’s not related to my changes. please once check Tour website

@JeelRajodiya
Copy link
Member

@techmannih that is okay, but we need to make the feature without any bugs. you can fix that problem in this PR.

@AQIB-NAWAB
Copy link
Contributor

Hi @JeelRajodiya , Might be this issue is same as mentioned in this issue .

@techmannih
Copy link
Contributor Author

@AQIB-NAWAB yeah this is same issue, are you working on this issue?
Thanks

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
3 participants