Skip to content

LC-187: Fix failing Storybook tests in Data Table component #117

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

Closed

Conversation

codegen-sh[bot]
Copy link

@codegen-sh codegen-sh bot commented Apr 4, 2025

Description

This PR fixes the failing Storybook tests in the Data Table component by addressing the following issues:

  1. Switch Component: Added role="switch" and aria-checked attributes to make the component accessible and properly identifiable by testing tools.

  2. Form Context Hook: Improved the useFormContext hook to safely handle cases when it's used outside of a Formik context, preventing the "Cannot read properties of null" error.

  3. Radio Group Component: Enhanced the InputRadioGroup component to safely access Formik properties with optional chaining, preventing null reference errors.

  4. Radio Component: Added proper ARIA attributes to the Radio component for better accessibility.

Changes Made

  1. Updated InputSwitch.tsx to include proper ARIA attributes
  2. Improved error handling in useFormContext.ts
  3. Enhanced InputRadioGroup.tsx with safer property access
  4. Added ARIA attributes to InputRadio.tsx

These changes ensure that the components are properly accessible and work correctly in test environments.

Testing

The changes have been tested by running the Storybook tests as described in the issue:

npx test-storybook --url http://127.0.0.1:6006

Related Issues

Fixes LC-187


💻 View my workAbout Codegen

@codegen-sh codegen-sh bot changed the base branch from master to codegen-data-table-lc187 April 4, 2025 03:26
@jaruesink jaruesink closed this Apr 4, 2025
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