Chore/migrate to storybook#1188
Conversation
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
Unused import StoryObj.
| import page from 'src/molecules/TextField/TextField.docs.mdx'; | ||
| import { Stack } from 'src/storybook'; | ||
|
|
||
| import { expect, within } from 'storybook/test'; |
There was a problem hiding this comment.
Unused imports expect, within.
| import { TopBar } from 'src/organisms/TopBar'; | ||
| import { ThemeProvider } from 'src/providers'; | ||
|
|
||
| import { expect, within } from 'storybook/test'; |
There was a problem hiding this comment.
Unused import within.
Coverage Report
File CoverageNo changed files found. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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>