Update storybook test patterns to match modern standards#99
Conversation
- Update imports from 'storybook/test' to '@storybook/test' - Add 'within' import for canvas element querying - Update play function signatures to use destructured parameters - Add step-based test organization for better debugging - Preserve existing test logic while modernizing structure - Apply patterns from date-picker and calendar components Files updated: - checkbox.stories.tsx: Added step organization and modern patterns - switch.stories.tsx: Updated imports and step structure - checkbox-custom.stories.tsx: Updated imports - switch-custom.stories.tsx: Updated imports and type fixes - checkbox-list.stories.tsx: Updated imports and dependencies - radio-group.stories.tsx: Updated imports and streamlined dependencies - radio-group-custom.stories.tsx: Updated imports and type fixes - text-field.stories.tsx: Updated imports - text-field-custom.stories.tsx: Updated imports and type fixes - textarea.stories.tsx: Updated imports - textarea-custom.stories.tsx: Updated imports - dropdown-menu-select.stories.tsx: Updated imports and dependencies - otp-input.stories.tsx: Updated imports and dependencies
|
|
|
Important Review skippedBot user detected. To trigger a single review, invoke the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
📝 Storybook Preview: View Storybook This preview will be updated automatically when you push new changes to this PR.
|
- Change FormLabel and FormMessage from type-only imports to actual imports - This fixes the 'Can't find variable: FormLabel' runtime error - Components need to be imported as actual values, not just types
|
✅ Fixed the switch-custom component error! The issue was that I've changed the import to: import { FormLabel, FormMessage } from '@lambdacurry/forms/remix-hook-form/form';This fixes the "Can't find variable: FormLabel" runtime error. The switch-custom component should now work properly! 🎯 🔄 View Updated PR #99 on Github 🔄 💻 View my work • React 👍 or 👎 |
c2d6439
into
codegen-bot/update-calendar-components-latest-shadcn
Summary
Updated all storybook test files to use the modern patterns established in the date-picker and calendar components. This brings consistency across all story tests and improves debugging capabilities.
Changes Made
Import Updates
'storybook/test'to'@storybook/test'withinimport for proper canvas element queryingPlay Function Modernization
play: async (storyContext) => {}toplay: async ({ canvasElement, step }) => {}const canvas = within(canvasElement);setupawait step('Description', async () => {})Test Organization
Applied step-based structure for better debugging:
Files Updated
Simple Toggle Components:
checkbox.stories.tsx- Full modernization with step organizationswitch.stories.tsx- Updated imports and step structurecheckbox-custom.stories.tsx- Import updatesswitch-custom.stories.tsx- Import and type fixesList and Group Components:
checkbox-list.stories.tsx- Import updates and dependency cleanupradio-group.stories.tsx- Streamlined importsradio-group-custom.stories.tsx- Import and type updatesText Input Components:
text-field.stories.tsx- Import updatestext-field-custom.stories.tsx- Import and type fixestextarea.stories.tsx- Import updatestextarea-custom.stories.tsx- Import updatesComplex Interactive Components:
dropdown-menu-select.stories.tsx- Import and dependency updatesotp-input.stories.tsx- Import and dependency updatesBenefits
Testing
All existing test logic has been preserved while updating the structure. The tests should continue to work as before but with improved organization and debugging capabilities.
💻 View my work • About Codegen