fix(storybook): add dialog title to Testing story#4664
fix(storybook): add dialog title to Testing story#4664CODEAbhinav-art wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: CODEAbhinav-art The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
2b4eb4e to
bc69819
Compare
|
@illume Please review |
illume
left a comment
There was a problem hiding this comment.
Looks good. I expect you need to update the snapshot tests.
Could you please check the commits?
c81574e to
725dd16
Compare
Done...! |
illume
left a comment
There was a problem hiding this comment.
@CODEAbhinav-art thanks for that.
Looking at this some more, this is strange… I would expect a change to the story rendering would make a change to a snapshot as well. This makes me think something is not right here. In 99% of cases if there is a change to how a component is rendered in the storybook, it will update the snapshots.
Can you please double check this? Or show me the before and after where you can see the difference in the DOM?
Thanks for pointing that out. I inspected the rendered DOM and noticed that in the Testing story, the visible h1-tag comes from the testingTitle prop, not title. Since I only updated the title prop, the snapshot did not change. I’m reviewing whether the correct prop should be updated to ensure the DialogTitle’s accessible name is populated as intended. |
725dd16 to
0c75748
Compare
|
@illume |
There was a problem hiding this comment.
Pull request overview
Updates the AuthChooser Storybook “Testing” story to use a meaningful dialog title, aiming to avoid rendering an unlabeled/empty heading in the testing dialog and keep storyshots in sync.
Changes:
- Set a specific
testingTitlefor theTestingstory args. - Updated the corresponding Storyshots snapshot to reflect the new title text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| frontend/src/components/authchooser/AuthChooser.stories.tsx | Sets testingTitle for the Testing story to provide a meaningful dialog title. |
| frontend/src/components/authchooser/snapshots/AuthChooser.Testing.stories.storyshot | Updates the snapshot to match the new dialog title text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export const Testing = Template.bind({}); | ||
| Testing.args = { | ||
| ...argFixture, | ||
| testingAuth: true, | ||
| testingTitle: 'Authenticating cluster access', | ||
| }; |
There was a problem hiding this comment.
In Storybook this dialog still renders an empty heading from the ClusterDialog header: ClusterDialog always renders a DialogTitle containing AppLogo, and with the default TestContext store plugins.loaded is false, so AppLogo renders EmptyContent and the title becomes an effectively empty <h1> (see the updated storyshot output). Setting testingTitle here only affects the inner dialog title, so the original a11y violation can still remain. Consider providing a mock store in the story decorator with plugins.loaded: true (and any minimal theme state), or otherwise ensuring the header DialogTitle has accessible text so no empty headings are produced in this story.
Summary
This PR fixes an accessibility issue in the AuthChooser Storybook Testing story where the dialog rendered a
DialogTitlewith no text, resulting in an empty<h1>.A meaningful testing dialog title is now provided so the dialog has a proper accessible name.
Related Issue
Fixes #4597
Changes
AuthChooser.stories.tsxto provide atestingTitlefor the Testing story<h1>in the Storybook dialogSteps to Test
cd frontend npm run storybookScreenshots (if applicable)

Notes for the Reviewer