frontend: add tests and stories for AuthToken Component#4761
frontend: add tests and stories for AuthToken Component#4761aravind4799 wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: aravind4799 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 |
1248737 to
12be462
Compare
There was a problem hiding this comment.
Pull request overview
Adds automated tests and Storybook coverage for the AuthToken / PureAuthToken auth-token dialog to improve UI-state documentation and component test coverage (per #4684).
Changes:
- Adds a new Vitest test suite covering key
PureAuthTokenrender states and basicAuthTokenfailure behavior. - Adds new Storybook stories for common
PureAuthTokenstates plus “stateful”AuthTokenstories driven by MSW handlers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| frontend/src/components/account/AuthToken.stories.tsx | Adds presentational + MSW-backed stateful stories and interaction plays for AuthToken UI states. |
| frontend/src/components/account/Auth.test.tsx | Adds unit tests for PureAuthToken rendering/callbacks and basic stateful error handling. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
12be462 to
9f64a7a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9f64a7a to
6aeb1e1
Compare
- Tests use vi.mock to prevent k8s circular dependency during import - Mock useNavBarMode since TestContext lacks MUI ThemeProvider - Coverage for Auth.tsx improved from 18% to ~79% - fixed: canvasElement.ownerDocument.body -> canvasElement
6aeb1e1 to
edfc77e
Compare
|
resolved co-pilot suggestions and rebased, PTAL @illume |
Summary
Add Storybook stories for the Auth.tsx component to improve coverage and document UI states.
Related Issue
Fixes #4684
Changes
frontend/src/components/account/Auth.test.tsxfrontend/src/components/account/AuthToken.stories.tsxNotes for the Reviewer