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