From 8ca5df9aca0ba137264041d580fd5ee4cfc84946 Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 22 Jan 2025 18:01:31 +0000 Subject: [PATCH 1/2] don't render hook steps with no content --- src/components/gherkin/HookSteps.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/gherkin/HookSteps.tsx b/src/components/gherkin/HookSteps.tsx index 351f0a65..b5211255 100644 --- a/src/components/gherkin/HookSteps.tsx +++ b/src/components/gherkin/HookSteps.tsx @@ -10,11 +10,12 @@ interface IProps { export const HookSteps: React.FunctionComponent = ({ hookSteps }) => { return ( <> - {hookSteps.map((step, index) => ( -
  • - -
  • - ))} + {hookSteps + .map((step, index) => ) + .filter((el) => !!el.props.children?.length) + .map((el, index) => ( +
  • {el}
  • + ))} ) } From 9ce92ae241b0063256b90b681c7ca402b58de286 Mon Sep 17 00:00:00 2001 From: David Goss Date: Wed, 22 Jan 2025 18:10:05 +0000 Subject: [PATCH 2/2] update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39857e50..37dd1520 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Fixed +- Don't render hook steps with no content ([#361](https://github.com/cucumber/react-components/pull/361)) ## [22.3.0] - 2024-08-02 ### Added