Skip to content
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

Filter out empty suite results for version #153

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { SuiteResult } from "@site/src/components/conformance/types";
import { SuiteResult, TestStats } from "@site/src/components/conformance/types";

import styles from "./styles.module.css";

Expand All @@ -14,6 +14,10 @@ export default function SuiteSelector(props: SelectorProps): JSX.Element {
<div className={styles.suiteSelector}>
{props.suites
.sort((a, b) => a.name.localeCompare(b.name))
.filter((suite) => {
let versionStats: TestStats = suite.versionedStats[props.esFlag];
return versionStats.total !== 0;
})
.map((suite) => {
return (
<SuiteItem
Expand Down
15 changes: 10 additions & 5 deletions src/components/conformance/ResultsDisplay/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ type ResultsNavProps = {
export default function ResultNavigation(props: ResultsNavProps): JSX.Element {
return (
<div className={styles.resultsNav}>
<EcmaScriptVersionDropdown setEcmaScriptFlag={props.setEcmaScriptFlag} esVersionValue={props.state.ecmaScriptVersion} />
<EcmaScriptVersionDropdown
setEcmaScriptFlag={props.setEcmaScriptFlag}
esVersionValue={props.state.ecmaScriptVersion}
/>
<NavBreadCrumbs
navPath={props.state.testPath}
sliceNavToIndex={props.sliceNavToIndex}
Expand Down Expand Up @@ -79,12 +82,14 @@ type DropDownProps = {
};

function EcmaScriptVersionDropdown(props: DropDownProps): JSX.Element {
const [dropdownValue, setDropdownValue] = React.useState(props.esVersionValue ? props.esVersionValue : "");
const [dropdownValue, setDropdownValue] = React.useState(
props.esVersionValue ? props.esVersionValue : "",
);

// Update the flag when props.esVersionValue is changed
React.useEffect(()=>{
setDropdownValue(props.esVersionValue)
}, [props.esVersionValue])
React.useEffect(() => {
setDropdownValue(props.esVersionValue);
}, [props.esVersionValue]);

const handleVersionSelection = (e) => {
// Update the display value and set the flag.
Expand Down