Skip to content

Conversation

@badeball
Copy link
Member

🤔 What's changed?

A list below GherkinDocument, showing BeforeAll(..) and AfterAll(..) hooks.

⚡️ What's your motivation?

Errors in BeforeAll(..) leads to a merely empty document - this shows why, in addition to adding support for presenting run hooks attachments.

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Anything, really. I'm new to the project and even ladle.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@badeball badeball requested a review from davidjgoss September 22, 2025 12:31
@netlify
Copy link

netlify bot commented Sep 22, 2025

Deploy Preview for cucumber-react-preview ready!

Name Link
🔨 Latest commit 88e15de
🔍 Latest deploy log https://app.netlify.com/projects/cucumber-react-preview/deploys/690b51d111f3c50008bcf82b
😎 Deploy Preview https://deploy-preview-408--cucumber-react-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

@davidjgoss davidjgoss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. Looks good, but some fairly minor feedback and suggestions.

I noticed on the story for BeforeAll errors that the <FilteredDocuments> component renders "nothing found" when really there are just no test cases at all - I'm reworking the search/filtering behaviour on another branch so I'll aim to take care of this over there, but I'm glad this change shone a light on it.


export const RunHooksList: FunctionComponent<{ children: ReactNode }> = ({ children }) => {
return (
<ol aria-label="RunHooks" className={styles.hooks}>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave it to consumers to decide if/how to label this section with e.g. headings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How were you thinking? EG. a aria-label prop?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would envisage more like a consumer doing:

return <>
  <h2>Hooks!</h2>
  <TestRunHooks/>
</>

So I think it's fine to just do nothing here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think such heading such be conditionally rendered in @cucumber/html-formatter based on existence of test run hooks?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, the list itself can render something like No hooks found, or similar.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, the list itself can render something like No hooks found, or similar.

Yeah, I think that would work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed with 88e15de

Leave this to the consumer.
This served little to no purpose.
This may be used by consumers of <TestRunHooks /> to eg. conditionally
render a heading.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants