diff --git a/app/components/Output/Output.tsx b/app/components/Output/Output.tsx
index de743bd..0c295c6 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";
@@ -28,17 +28,17 @@ const SchemaError = ({ schemaPath }: { schemaPath: string }) => {
You are using invalid type or keyword in the schema. The type should be
one of the valid JSON Schema types. The valid types are:{" "}
{JSONSchemaTypes.map((t) => (
- <>
- {t}
+
+ {t}
{", "}
- >
+
))}
>
);
const possibleFixes = [
"Check that the type specified is one of the valid JSON Schema types",
"Correct any typos in the type name",
- <>
+
Ensure you are using valid keywords for the JSON Schema version you are
using. You can view all the JSON Schema keywords for the latest version{" "}
{
>
here
- >,
+ ,
];
return (
@@ -87,10 +87,9 @@ function Output({
}) {
let outputBodyContent;
- if (outputResult.validityStatus == "neutral") {
+ if (outputResult.validityStatus === "neutral") {
outputBodyContent = (
- {" "}
Please click the{" "}
{}}>
validate
@@ -99,22 +98,37 @@ function Output({
output
);
- } else if (outputResult.validityStatus == "valid") {
- outputBodyContent = (
-
- Valid Schema!
-
- Let's move on to the next step
-
-
- );
- } else if (outputResult.validityStatus == "syntaxError") {
+ } else if (outputResult.validityStatus === "valid") {
+ if (outputResult.testCaseResults && outputResult.totalTestCases) {
+ outputBodyContent = (
+
+
+ Valid Schema!
+
+
+
+ );
+ } else {
+ outputBodyContent = (
+
+ Valid Schema!
+
+ Let's move on to the next step
+
+
- Invalid Schema!
+ {/* Reverted to original "Invalid Schema!" for invalid case */}
+ {!isValidSchema && (
+ Invalid Schema!
+ )}
- {numberOfFailedTestCases} out of {totalTestCases} test cases failed
+ {isValidSchema
+ ? `All ${totalTestCases} test cases passed`
+ : `${numberOfFailedTestCases} out of ${totalTestCases} test cases failed`}