-
Notifications
You must be signed in to change notification settings - Fork 890
Connection: Step survey - modernize components and fix for accessibility #50776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
coder-karen
merged 6 commits into
trunk
from
update/connection-js-package-disconnect-survey
Jul 27, 2026
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
202bfef
Ensure step survey uses modern components and is accessible
coder-karen 8a99189
Switch to Card component usage
coder-karen 98c47ac
Add new test files and tests related to the survey
coder-karen 8312609
Comment cleanup
coder-karen c3e03eb
Disconnection survey input style tweak and adding id and name
coder-karen b2bad02
Merge branch 'trunk' into update/connection-js-package-disconnect-survey
coder-karen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/js-packages/connection/changelog/update-connection-js-package-ui-pt6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Significance: patch | ||
| Type: changed | ||
|
|
||
| Connection UI: Make the disconnect survey a real radio group, drop the decorative arrow the options no longer need, and build the option cards on the shared Card component. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
projects/js-packages/connection/components/disconnect-dialog/test/step-survey.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| import { jest } from '@jest/globals'; | ||
| import { render, screen } from '@testing-library/react'; | ||
| import userEvent from '@testing-library/user-event'; | ||
| import StepSurvey from '../steps/step-survey'; | ||
|
|
||
| describe( 'StepSurvey', () => { | ||
| const testProps = { | ||
| onExit: jest.fn(), | ||
| onFeedBackProvided: jest.fn(), | ||
| }; | ||
|
|
||
| afterEach( () => { | ||
| testProps.onExit.mockClear(); | ||
| testProps.onFeedBackProvided.mockClear(); | ||
| } ); | ||
|
|
||
| it( 'renders the heading and intro copy', () => { | ||
| render( <StepSurvey { ...testProps } /> ); | ||
|
|
||
| expect( screen.getByRole( 'heading' ) ).toHaveTextContent( | ||
| 'Before you go, help us improve Jetpack' | ||
| ); | ||
| expect( screen.getByText( "Let us know what didn't work for you" ) ).toBeInTheDocument(); | ||
| } ); | ||
|
|
||
| it( 'renders the survey options', () => { | ||
| render( <StepSurvey { ...testProps } /> ); | ||
| expect( screen.getAllByRole( 'radio' ) ).toHaveLength( 6 ); | ||
| } ); | ||
|
|
||
| it( 'passes the survey response up on submit', async () => { | ||
| const user = userEvent.setup(); | ||
| render( <StepSurvey { ...testProps } /> ); | ||
|
|
||
| await user.click( screen.getByText( "It's buggy." ) ); | ||
| await user.click( screen.getByRole( 'button', { name: 'Submit Feedback' } ) ); | ||
|
|
||
| expect( testProps.onFeedBackProvided ).toHaveBeenCalledWith( 'buggy', '' ); | ||
| } ); | ||
|
|
||
| it( 'calls onExit when "Skip for now" is clicked', async () => { | ||
| const user = userEvent.setup(); | ||
| render( <StepSurvey { ...testProps } /> ); | ||
|
|
||
| await user.click( screen.getByRole( 'link', { name: 'Skip for now' } ) ); | ||
|
|
||
| expect( testProps.onExit ).toHaveBeenCalledTimes( 1 ); | ||
| } ); | ||
| } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.