-
Notifications
You must be signed in to change notification settings - Fork 2
Chore/migrate to storybook #1188
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates test coverage from standalone .test.tsx files to Storybook stories with play functions, enabling visual testing and interaction testing within Storybook.
Key Changes:
- Removal of traditional unit test files (
.test.tsx) - Addition of test-only stories with
playfunctions in.stories.tsxfiles - Migration from
@testing-librarypatterns to Storybook'suserEventandwithinutilities
Reviewed changes
Copilot reviewed 64 out of 64 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/molecules/Waves/Waves.stories.tsx | Added test stories for SVG rendering, gradient colors, and viewBox |
| src/molecules/Toast/Toast.stories.tsx | Added test story for negative duration validation |
| src/molecules/TextField/TextField.stories.tsx | Added imports but missing test stories despite test file deletion |
| src/molecules/Tabs/Tabs.stories.tsx | Added test stories for tab interactions, icons, and counts |
| src/molecules/SelectionControls/*/stories.tsx | Added test stories for label rendering and checked states |
| src/molecules/RichTextEditor/RichTextEditor.stories.tsx | Added comprehensive test stories for MenuBar feature visibility |
| src/molecules/ProfileAvatar/ProfileAvatar.stories.tsx | Added test stories for fallback icons, images, and initials |
| src/molecules/InfoElement/*.stories.tsx | Added test stories for content rendering and copyable functionality |
| src/molecules/FileProgress/FileProgress.stories.tsx | Added extensive test stories for loading, error, and complete states |
| src/molecules/DatePicker/DatePicker.stories.tsx | Added test stories for format, locale, and loading states |
| src/molecules/Chip/Chip.stories.tsx | Added test stories for interactions, events, and disabled state |
| src/molecules/Button/Button.stories.tsx | Added test stories for loading state preventing clicks |
| src/molecules/ApplicationIcon/*.stories.tsx | Added test stories for icon rendering and fallback behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| warning_filled, | ||
| } from '@equinor/eds-icons'; | ||
| import { Meta, StoryFn } from '@storybook/react-vite'; | ||
| import { Meta, StoryFn, StoryObj } from '@storybook/react-vite'; |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import StoryObj.
| import page from 'src/molecules/TextField/TextField.docs.mdx'; | ||
| import { Stack } from 'src/storybook'; | ||
|
|
||
| import { expect, within } from 'storybook/test'; |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused imports expect, within.
| import { TopBar } from 'src/organisms/TopBar'; | ||
| import { ThemeProvider } from 'src/providers'; | ||
|
|
||
| import { expect, within } from 'storybook/test'; |
Copilot
AI
Nov 25, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import within.
Coverage Report
File CoverageNo changed files found. |
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 64 out of 64 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| import { Meta, StoryFn } from '@storybook/react-vite'; | ||
| import { Meta, StoryFn, StoryObj } from '@storybook/react-vite'; | ||
| import { expect, within } from 'storybook/test'; | ||
| import { vi } from 'vitest'; |
Copilot
AI
Nov 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing import for vi from vitest. The vi object is used on line 82 (vi.spyOn) and line 535 (vi.fn()), but it's not imported. This will cause a reference error at runtime.
Azure DevOps links
User story
Tasks
Description
Test steps
<url>