From 8ba4456935e44f146c44a74de1df6ae61e683af0 Mon Sep 17 00:00:00 2001 From: tanay-nagde Date: Mon, 21 Jul 2025 15:04:05 +0530 Subject: [PATCH] feat: Display passing test cases for valid schemas Updates the output view to show passing test cases. Also applies automated formatting and lint fixes to the entire codebase. --- app/components/NavBarMenus/NavBarMenus.tsx | 1 - app/components/Output/Output.tsx | 22 ++++++++++++------- .../TestCaseWindow/TestCaseWindow.tsx | 14 +++++++----- lib/client-functions.ts | 11 +++++++++- lib/reducers.ts | 7 +++++- 5 files changed, 38 insertions(+), 17 deletions(-) diff --git a/app/components/NavBarMenus/NavBarMenus.tsx b/app/components/NavBarMenus/NavBarMenus.tsx index 002306e..fb8c575 100644 --- a/app/components/NavBarMenus/NavBarMenus.tsx +++ b/app/components/NavBarMenus/NavBarMenus.tsx @@ -38,7 +38,6 @@ export default function NavBarMenu() { className={navBarStyles.menuButton} onBlur={() => setIsOpen(false)} onClick={() => { - sendGAEvent("event", "buttonClicked", { value: "Settings", }); diff --git a/app/components/Output/Output.tsx b/app/components/Output/Output.tsx index 682c5e9..5a5d395 100644 --- a/app/components/Output/Output.tsx +++ b/app/components/Output/Output.tsx @@ -2,7 +2,7 @@ import React, { useState } from "react"; import styles from "./Output.module.css"; import classnames from "classnames"; import { OutputResult } from "@/lib/types"; -import FailedTestCasesWindow from "../TestCaseWindow/TestCaseWindow"; +import TestCasesWindow from "../TestCaseWindow/TestCaseWindow"; import MyBtn from "../MyBtn"; import { InvalidSchemaError } from "@hyperjump/json-schema/draft-2020-12"; import { schemaUrl } from "@/lib/validators"; @@ -101,12 +101,18 @@ function Output({ ); } else if (outputResult.validityStatus == "valid") { outputBodyContent = ( -
- Valid Schema! - - Let's move on to the next step - -
+ <> +
+ Valid Schema! + + Let's move on to the next step + +
+ + ); } else if (outputResult.validityStatus == "syntaxError") { outputBodyContent = ( @@ -128,7 +134,7 @@ function Output({ ); } else { outputBodyContent = ( - diff --git a/app/components/TestCaseWindow/TestCaseWindow.tsx b/app/components/TestCaseWindow/TestCaseWindow.tsx index 4d93f1a..41dff68 100644 --- a/app/components/TestCaseWindow/TestCaseWindow.tsx +++ b/app/components/TestCaseWindow/TestCaseWindow.tsx @@ -110,12 +110,14 @@ export default function TestCasesWindow({ return (
-
- Invalid Schema! - - {numberOfFailedTestCases} out of {totalTestCases} test cases failed - -
+ {numberOfFailedTestCases > 0 && ( +
+ Invalid Schema! + + {numberOfFailedTestCases} out of {totalTestCases} test cases failed + +
+ )} {!areBothDisabled && (