Skip to content

Conversation

@aboungnaseng-ovhcloud
Copy link
Contributor

@aboungnaseng-ovhcloud aboungnaseng-ovhcloud commented Oct 29, 2025

Description

Summary: Added Size and Variant Testing & Controls for Datagrid Component

Screenshot 2025-10-29 at 16 43 42 Screenshot 2025-10-29 at 16 43 21 Screenshot 2025-10-29 at 16 39 20 Screenshot 2025-10-29 at 16 39 04

Test Coverage Additions

1. Snapshot Tests (Datagrid.snapshot.spec.tsx)

  • Added 4 new snapshot tests for size and variant attributes:
    • Small size (TABLE_SIZE.sm)
    • Medium size (TABLE_SIZE.md)
    • Large size (TABLE_SIZE.lg)
    • Striped variant (TABLE_VARIANT.striped)

2. Functional Tests (Datagrid.spec.tsx)

  • Created new "Table Styles" test suite with 3 tests:
    • Small size → validates table--sm class
    • Large size → validates table--lg class
    • Striped variant → validates table--striped class
  • Applied code formatting improvements (line breaks, spacing)

3. Storybook Controls (datagrid.stories.tsx)

  • Added interactive controls in Storybook's control panel:
    • size control: select dropdown with sm/md/lg options
    • variant control: select dropdown with default/striped options

Technical Changes

  • Added imports for TABLE_SIZE and TABLE_VARIANT from @ovhcloud/ods-react
  • Used className.toContain() assertions to verify correct CSS classes are applied
  • Improved code formatting for better readability

Impact

This commit enhances test coverage and improves the developer experience by making size and variant options easily testable and configurable in Storybook.

@aboungnaseng-ovhcloud aboungnaseng-ovhcloud requested a review from a team as a code owner October 29, 2025 09:48
@github-actions github-actions bot added the feature New feature label Oct 29, 2025
@aboungnaseng-ovhcloud aboungnaseng-ovhcloud force-pushed the feat/MANAGER-20066 branch 7 times, most recently from 84257e7 to f2f4733 Compare October 29, 2025 13:59
@aboungnaseng-ovhcloud aboungnaseng-ovhcloud changed the title Feat/manager 20066 [MUK]: Add datagrid size and variant Oct 29, 2025
ref: #MANAGER-20066

Signed-off-by: Alex Boungnaseng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants