What problem does it solve?
This Skill solves flaky or misleading test suites for CometChat React UI Kit integrations by giving a consistent, production-aligned testing blueprint for unit, component, and end-to-end chat flows.
Core Features & Use Cases
- Vitest + React Testing Library foundation: Provides a jsdom test environment setup, cleanup discipline, and common browser API polyfills (WebSocket, matchMedia) so UI tests run reliably.
- Deterministic SDK mocking: Defines a canonical hoisted mock for @cometchat/chat-sdk-javascript and @cometchat/chat-uikit-react, enabling reliable init/login/render behavior tests without real network calls.
- Chat-specific safety assertions: Includes rules that validate init ordering, verify visible error UI on failures (including red/error styling checks), ensure no Auth Key leakage in test-adjacent source, and confirm css-variables.css is imported exactly once.
- Playwright e2e chat smoke tests: Adds a two-user messaging smoke test and CI-friendly configuration to validate real chat behavior over WebSocket.
- Use Case: When upgrading CometChat UI Kit or migrating frameworks (Vite/Next.js/Astro), use this Skill to quickly establish reliable regression coverage for core chat flows and catch integration breaks early.
Quick Start
Use the cometchat-react-testing Skill to generate a Vitest setup, shared SDK mocks, and one Playwright two-user chat smoke test for your project’s existing CometChat integration.