frontend: PortForward: Add stories for various connection states#4698
frontend: PortForward: Add stories for various connection states#4698aravind4799 wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
|
|
Welcome @aravind4799! |
There was a problem hiding this comment.
Pull request overview
Adds a new Storybook story file for the PortForward resource action so developers can visually verify and regression-test key UI states (initial form, loading, running, and error conditions) in isolation.
Changes:
- Added
PortForward.stories.tsxundercomponents/common/Resourcewith 5 stories covering common connection states. - Introduced MSW handlers per story to mock port-forward list/start responses.
- Added
playfunctions to drive the UI into loading/error states via user interaction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/components/common/Resource/PortForward.stories.tsx
Outdated
Show resolved
Hide resolved
frontend/src/components/common/Resource/PortForward.stories.tsx
Outdated
Show resolved
Hide resolved
skoeva
left a comment
There was a problem hiding this comment.
this could use a rebase against main
|
Fixed : added storyshots: { disable: true } for stories with play functions, updated userEvent to v14 .setup() pattern, and added beforeEach cleanup for window.process. |
|
Hi @illume , I've addressed the review comments and the CI workflow is awaiting approval |
illume
left a comment
There was a problem hiding this comment.
Thanks.
Can you please squash the commits?
For the git commit message body, please get rid of Signed-off-by and add something like the Changes part of the PR description, with any information about Why you did what you did in the change?
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
frontend/src/components/common/Resource/PortForward.stories.tsx
Outdated
Show resolved
Hide resolved
- Refactor withElectronEnv decorator to remove duplicate logic already handled in beforeEach. - Update MSW mock endpoint to use wildcard pattern '*/api/v1/...' to support both clustered and non-clustered environments.
9a82b32 to
2936548
Compare
|
Hi @illume, |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aravind4799, illume The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
This PR adds Storybook stories for the PortForward component to visualize and test its various states, including the form, loading state, successful connection, and error handling.
Related Issue
Fixes #4689
Changes
mswfor mocking API responses and play functions for simulating user interactions.Steps to Test
npm run frontend:storybookNotes for the Reviewer
mswhandlers are used to force specific API responses (success, hang, error) for each story.