Skip to content

Fix select component tests in PR #127#131

Closed
codegen-sh[bot] wants to merge 27 commits intomainfrom
codegen-bot/fix-select-tests-pr127
Closed

Fix select component tests in PR #127#131
codegen-sh[bot] wants to merge 27 commits intomainfrom
codegen-bot/fix-select-tests-pr127

Conversation

@codegen-sh
Copy link
Copy Markdown
Contributor

@codegen-sh codegen-sh Bot commented Aug 19, 2025

This PR fixes the failing tests in PR #127 by:

  1. Updating the test imports in select.test.tsx to use the correct imports from @storybook/test instead of separate imports from @storybook/test and @storybook/testing-library
  2. Fixing the selectors in the test functions to use within(document.body).findByRole('option', { name: 'Option Name' }) instead of canvas.findByText('Option Name') to properly find dropdown options
  3. Improving the ARIA roles and semantics in the Select component to ensure proper accessibility and test interaction
  4. Using proper assertions to wait for the selection to be applied before checking the content
  5. Updating the story files to use the test functions correctly

These 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 workAbout Codegen

codegen-sh Bot and others added 25 commits August 16, 2025 04:11
- 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>
- 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.
@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Aug 19, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codegen-bot/fix-select-tests-pr127

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Aug 19, 2025

📝 Storybook Preview: View Storybook

This preview will be updated automatically when you push new changes to this PR.

Note: The preview will be available after the workflow completes and the PR is approved for deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant