Fix select component tests in PR #127#131
Conversation
- Create base RegionSelect component with shadcn styling - Add US_STATES and CANADA_PROVINCES data - Create convenience wrapper components for US states and Canada provinces - Create form-aware wrapper components for remix-hook-form - Add Storybook stories and tests Co-authored-by: Jake Ruesink <jake@lambdacurry.com>
…select stories - Removed direct dependency on @remix-run/react - Created a mock fetcher implementation for Storybook - Fixed build error in Storybook
- Update FormField import in region-select.tsx - Replace @storybook/jest with @storybook/test Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Update FormItem import in region-select.tsx - Replace @storybook/jest with @storybook/test Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Use withReactRouterStubDecorator instead of mock fetcher - Update story structure to match other components - Improve test organization with step function - Add source code example in docs Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Add search functionality - Remove check icon from trigger - Improve dropdown styling - Add react-stately dependency Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Lighten selected gray background - Darken hover gray background - Remove black border around dropdown - Make search input full width without border Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Fix Alabama gray background issue by removing default background - Add auto-scroll to selected item when dropdown opens - Improve hover and selected state styling Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
- Remove bg-gray-50 from first item - Install Playwright for Storybook tests Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
Co-authored-by: Jake Ruesink <jake@lambdacurry.dev>
…and Canada province helpers
- Updated imports in data files to use SelectOption from select.tsx instead of RegionOption from region-select.tsx - Removed non-existent tooltip export from UI index file
- Removed dropdown-menu-select-field.tsx from UI components - Removed dropdown-menu-select.tsx from remix-hook-form components - Removed dropdown-menu-select.stories.tsx from docs - Updated index files to remove exports for these components This completes the migration to the new Select component.
…workspaces configuration. Refactor select component imports and improve accessibility features in select.tsx and phone-input-field.tsx. Enhance Storybook stories for region selection components with better querying methods.
…ambda-curry/forms into codegen-bot/refactor-select-components
…er decorators and enhancing play functionality for form submission tests. This improves the structure and readability of the stories while ensuring comprehensive testing of user interactions.
… `components` prop to allow users to override FormControl, FormLabel, FormDescription, and FormMessage. Updated Select UI to utilize default icons and support custom Trigger, Item, and SearchInput components.
…e version to 0.19.4 in package.json.
|
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type 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.
|
This PR fixes the failing tests in PR #127 by:
select.test.tsxto use the correct imports from@storybook/testinstead of separate imports from@storybook/testand@storybook/testing-librarywithin(document.body).findByRole('option', { name: 'Option Name' })instead ofcanvas.findByText('Option Name')to properly find dropdown optionsThese changes ensure that the tests can properly interact with the new Select component that replaces the previous DropdownMenuSelect component.
Note: This PR is based on PR #127 and contains only the fixes for the failing tests. It should be merged into PR #127 first, or the changes can be cherry-picked into PR #127.
💻 View my work • About Codegen