Skip to content

Commit c232f2b

Browse files
authored
Filter out empty suite results for version (#153)
* Filter out empty suite results for version * Remove a console log
1 parent 3842ab5 commit c232f2b

File tree

2 files changed

+15
-6
lines changed
  • src/components/conformance/ResultsDisplay

2 files changed

+15
-6
lines changed

src/components/conformance/ResultsDisplay/components/SuiteSelector/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import { SuiteResult } from "@site/src/components/conformance/types";
2+
import { SuiteResult, TestStats } from "@site/src/components/conformance/types";
33

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

@@ -14,6 +14,10 @@ export default function SuiteSelector(props: SelectorProps): JSX.Element {
1414
<div className={styles.suiteSelector}>
1515
{props.suites
1616
.sort((a, b) => a.name.localeCompare(b.name))
17+
.filter((suite) => {
18+
let versionStats: TestStats = suite.versionedStats[props.esFlag];
19+
return versionStats.total !== 0;
20+
})
1721
.map((suite) => {
1822
return (
1923
<SuiteItem

src/components/conformance/ResultsDisplay/nav.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type ResultsNavProps = {
1313
export default function ResultNavigation(props: ResultsNavProps): JSX.Element {
1414
return (
1515
<div className={styles.resultsNav}>
16-
<EcmaScriptVersionDropdown setEcmaScriptFlag={props.setEcmaScriptFlag} esVersionValue={props.state.ecmaScriptVersion} />
16+
<EcmaScriptVersionDropdown
17+
setEcmaScriptFlag={props.setEcmaScriptFlag}
18+
esVersionValue={props.state.ecmaScriptVersion}
19+
/>
1720
<NavBreadCrumbs
1821
navPath={props.state.testPath}
1922
sliceNavToIndex={props.sliceNavToIndex}
@@ -79,12 +82,14 @@ type DropDownProps = {
7982
};
8083

8184
function EcmaScriptVersionDropdown(props: DropDownProps): JSX.Element {
82-
const [dropdownValue, setDropdownValue] = React.useState(props.esVersionValue ? props.esVersionValue : "");
85+
const [dropdownValue, setDropdownValue] = React.useState(
86+
props.esVersionValue ? props.esVersionValue : "",
87+
);
8388

8489
// Update the flag when props.esVersionValue is changed
85-
React.useEffect(()=>{
86-
setDropdownValue(props.esVersionValue)
87-
}, [props.esVersionValue])
90+
React.useEffect(() => {
91+
setDropdownValue(props.esVersionValue);
92+
}, [props.esVersionValue]);
8893

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

0 commit comments

Comments
 (0)