Skip to content

Conversation

@skrulling
Copy link
Collaborator

@skrulling skrulling commented Jan 6, 2026

This PR introduces smoke tests for both @highcharts/grid-lite-react and @highcharts/grid-pro-react. It refactors the shared test utilities to support dynamic option updates and significantly improves the robustness of the useGrid hook to handle initialization race conditions.

Changes

Testing

  • New Smoke Tests: Added Grid.test.tsx for both Lite and Pro packages to verify basic rendering, ref access, and callbacks.
  • E2E Tests: Added tests that serve the React and Next.js demos and make sure that they a functional.

Core Logic

  • useGrid Hook: Improved robustness in packages/grid-shared-react/src/hooks/useGrid.ts:
    • Added initStartedRef to prevent double initialization.
    • Implemented pendingOptionsRef to queue option updates that occur while the grid is asynchronously initializing.
    • Added cleanup checks to prevent errors if the component unmounts during initialization.

Verification

  • Run pnpm test:all to verify all smoke tests pass without warnings.
  • Run pnpm build to ensure TypeScript compilation succeeds across all packages.

…tes and add tests for dynamic option changes and unmount behavior
Copy link
Member

@ddragula ddragula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Collaborator

@sebastianbochan sebastianbochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unable to run NextJS demos; the screen is blank.

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.

4 participants