Creator · cometchat
Last updated · Sep 7, 2026
Testing patterns for CometChat React Native — Jest + React Native Testing Library setup, mocking the UI Kit + SDK, testing custom bubbles / headers / composer actions, snapshot pitfalls, E2E with Detox vs Maestro, and CI integration. Covers what to test vs what to skip.
Sandbox only
Install targets
Codex install prompt
Install the "cometchat-native-testing" agent skill from https://github.com/cometchat/cometchat-skills/tree/main/packages/skills-native/skills/cometchat-native-testing. Read its SKILL.md or equivalent instructions first, install only the files needed for this workspace, and summarize any required setup before using it. Skill purpose: Testing patterns for CometChat React Native — Jest + React Native Testing Library setup, mocking the UI Kit + SDK, testing custom bubbles / headers / composer actions, snapshot pitfalls, E2E with Detox vs Maestro, and CI integration. Covers what to test vs what to skip. After the install attempt, report the result to https://www.openagentskill.com/api/agent/outcome with POST JSON {"event_id":"install_<unique-id>","skill_slug":"cometchat-cometchat-native-testing","task":"Install cometchat-native-testing","agent":"codex","outcome":"success","install_used":true}. Replace event_id with a unique value and outcome with success or failed. Report success only after the skill is installed and a minimal verification passes.Supply asset profile
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Scenario
Testing and QA
I need my agent to test a web app, reproduce bugs, and verify fixes.
Agent fit
Claude Code + CLI + Codex
Codex, Claude Code, Cursor, CLI, or custom agents.
Install
Ready
npx skills add cometchat/cometchat-skills --skill cometchat-native-testing
Maintenance
active
1mo since push
Risk
Needs review
Dependency or permission surface needs review
GitHub quality
100
61/100 Quality · 71/100 Trust
Coverage tags
Review notes
Dependency or permission surface needs review · Permission surface may require sandboxing
Agent adoption scorecard
These scores combine public repository metadata, OpenAgentSkill review signals, maintenance freshness, and install readiness. They are a shortlist signal, not a replacement for human review.
Quality
PromisingUseful candidate, but compare it with alternatives before adopting.
Trust
Sandbox onlyUseful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
Audit
Needs reviewA machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
OpenAgentSkill Trust Score v5
Run only in a sandbox and compare close alternatives before using it for real work.
Stars
100 GitHub stars
Repo activity
100 stars, 2 forks
Maintenance
1mo since push
License
MIT
Install
npx skills add cometchat/cometchat-skills --skill cometchat-native-testing
Install safety
Agent-readable metadata
Use this block or the embedded JSON to decide whether an agent should install this skill, choose an alternative, or ask for human review first.
Suited tasks
Suited agents
Install decision
Trust and risk
Outcome loop
Install command
npx skills add cometchat/cometchat-skills --skill cometchat-native-testingDo not use when
Alternative
175.1K Stars
npx skills add anthropics/skills --skill frontend-design
Alternative
85.2K Stars
npx skills add Leonxlnx/taste-skill --skill design-taste-frontend
Alternative
1.8K Stars
npx skills add Alisa0808/vox-director --skill vox-director
Alternative
175.1K Stars
npx skills add anthropics/skills --skill canvas-design
Agent safety v2
This skill should not be selected by an agent without explicit human security review.
Do not auto-install. Inspect the source, dependencies, and permission surface first.
high
Skill metadata references terminal, CLI, shell, subprocess, or command execution workflows.
medium
Skill likely fetches remote pages, APIs, repositories, or external services.
high
Skill metadata references credentials, tokens, environment variables, or secret-bearing workflows.
Agent resolve plan
The Resolve API returns the selected skill, alternatives, safety policy, audit notes, install target, and copy-paste prompt an agent can follow without scraping this page.
Open JSON
/api/agent/resolve?task=Use%20cometchat-native-testing%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve text
/api/agent/resolve?task=Use%20cometchat-native-testing%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Install handoff
/api/skills/cometchat-cometchat-native-testing/install
Agent should check
Copy prompt
Task: Use cometchat-native-testing in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20cometchat-native-testing%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/cometchat-cometchat-native-testing/install
Install command: npx skills add cometchat/cometchat-skills --skill cometchat-native-testing
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent handoff
Use the public install endpoint to fetch the command, safety checklist, target prompts, and canonical links for this skill.
Install handoff
/api/skills/cometchat-cometchat-native-testing/install
LLM text format
/api/skills/cometchat-cometchat-native-testing/install?format=text
Find alternatives
/api/skills/search?q=cometchat-native-testing&limit=3
Agent prompt
Use cometchat-native-testing for this task. Review https://www.openagentskill.com/api/skills/cometchat-cometchat-native-testing/install, then install with: npx skills add cometchat/cometchat-skills --skill cometchat-native-testingRegistry metadata
This page exposes the same decision, trust, audit, use-case, and install signals through the Registry API, so agents can rank this skill without scraping the UI.
Manifest
/api/registry/manifest/cometchat-cometchat-native-testing
LLM text
/api/registry/manifest/cometchat-cometchat-native-testing?format=text
Install alias
/api/registry/install/cometchat-cometchat-native-testing
Recommend
/api/registry/recommend?task=Use%20cometchat-native-testing%20in%20an%20agent%20workflow&limit=3
Agent fit
Testing and QA
Use-case tags
Platforms
Claude Code
Audit report
A machine-readable review of install readiness, security metadata, maintenance, and adoption risk.
Agent decision cockpit
Prototype with this skill first; keep a fallback candidate ready.
Role in stack
Fallback candidate
Primary fit
Testing and QA
Trust label
Prototype first
Install path
Command ready
Use when
Evidence
review first
Implementation path
Trust profile
Useful candidate with missing or mixed trust signals. Keep it in an isolated workspace until the outcome loop proves task fit.
GitHub adoption
INFO100 GitHub stars
Stars/forks activity
CHECK100 stars, 2 forks; issue activity unavailable in current metadata
Recent maintenance
PASS1mo since push
License clarity
PASSMIT
Good signals
Review before install
Recommended action
Run only in a sandbox and compare close alternatives before using it for real work.
Quality profile
Useful candidate, but compare it with alternatives before adopting.
Workflow fit
Verify behavior
I need my agent to test a web app, reproduce bugs, and verify fixes.
Build and ship code
I need a coding agent that can understand a repository, edit code, and review pull requests.
Operate web apps
I need my agent to control a browser, fill forms, and verify web app workflows.
Workflow fit
Inspect, patch, and verify code
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Operate and verify web apps
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Design, build, test, and ship interfaces
A practical workflow for agents that turn product briefs or Figma designs into polished frontend code, review the result, test it in a browser, and prepare a safe deployment.
Alternative shortlist
Similar skills that may fit this task.
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
--- name: cometchat-native-testing description: "Testing patterns for CometChat React Native — Jest + React Native Testing Library setup, mocking the UI Kit + SDK, testing custom bubbles / headers / composer actions, snapshot pitfalls, E2E with Detox vs Maestro, and CI integration. Covers what to test vs what to skip." license: "MIT" compatibility: "Node.js >=18; React Native >=0.70; @cometchat/chat-uikit-react-native ^5; Jest ^29; @testing-library/react-native ^12" allowed-tools: "executeBash, readFile, fileSearch, listDirectory" metadata: author: "CometChat" version: "1.0.0" tags: "cometchat react-native testing jest rnt detox maestro ci" ---
## Purpose
Teaches Claude how to write and run tests against a CometChat React Native integration. Covers:
- Unit / component tests with Jest + React Native Testing Library (RNTL) - How to mock `@cometchat/chat-uikit-react-native` and `@cometchat/chat-sdk-react-native` (both pull in native modules that fail in Node's jest-expo / jest-react-native environments) - Testing custom bubbles, headers, composer actions, empty states - Snapshot testing pitfalls specific to theme-driven components - E2E with Detox (iOS + Android native drivers) vs Maestro (declarative YAML) - Which tests catch real regressions vs which are flaky churn
Ground truth: `@cometchat/chat-uikit-react-native@5.3.3`'s example jest config (`examples/SampleAppWithPushNotifications/jest.config.js`) and the standard RN testing toolkit docs (callstack.github.io/react-native-testing-library, wix.github.io/Detox, maestro.mobile.dev).
---
## 1. What to test, what to skip
Not every test is worth the maintenance cost. A few rules of thumb:
**Worth testing:** - Custom components you wrote (custom bubble, custom header, empty-state view) - Navigation logic triggered by CometChat events (push tap → deep-link) - Message render logic with text formatters - Your provider chain wires correctly (four-wrapper order, init called, login called) - Production auth token refresh + retry logic - User-ID mapping (Firebase UID → CometChat UID)
**Skip:** - UI Kit internals — that's the UI Kit's responsibility. Testing `<CometChatConversations>` renders a list is testing CometChat's code. - Realtime delivery (A sends, B receives) — requires real servers; flaky and slow; use manual QA or E2E with real accounts. - Presence / typing indicators — race-prone, depend on socket state. - Snapshot tests of CometChat components — theme changes, UI Kit updates, and `cometchat-native-theming` edits all churn the snapshots with no real signal. - Native module calls (camera, picker) — Jest's mocks already return stubs; testing them verifies the mock, not the integration.
The golden rule: if the test fails because **your code** changed, it's valuable. If it fails because **the UI Kit updated** or **a network blip happened**, it's churn.
---
## 2. Toolchain
| Layer | Tool | Why | |---|---|---| | Unit + component tests | Jest + `@testing-library/react-native` | The RN default. Preset handles metro module resolution. | | Mocking | Jest `moduleNameMapper` + manual mocks | UI Kit imports native modules — can't run real components in a Node env. | | Snapshot | Jest's built-in | Use sparingly — see §7 | | E2E | Maestro OR Detox | See §10 for tradeoff | | CI | GitHub Actions / EAS / Bitrise | §11 |
Install: ```bash # Bare RN npm install --save-dev jest @testing-library/react-native @testing-library/jest-native \ react-test-renderer @types/jest
# Expo npx expo install --dev jest-expo @testing-library/react-native @testing-library/jest-native \ react-test-renderer ```
`jest-expo` wraps `react-native` preset with Expo-specific module resolution (handles `expo-modules-core`, `expo-router`, etc.).
---
## 3. Jest config
**Bare RN** — `jest.config.js`: ```js module.exports = { preset: "react-native", setupFilesAfterEach: ["<rootDir>/jest.setup.ts"], transformIgnorePatterns: [ "node_modules/(?!(?:react-native|@react-native|@react-navigation|" + "@cometchat/chat-uikit-react-native|@cometchat/chat-sdk-react-native|" + "react-native-.+|@notifee/react-native)/)", ], moduleNameMapper: { "^@cometchat/chat-uikit-react-native$": "<rootDir>/__mocks__/cometchat-uikit.ts", "^@cometchat/chat-sdk-react-native$": "<rootDir>/__mocks__/cometchat-sdk.ts", }, }; ```
**Expo** — `jest.config.js`: ```js module.exports = { preset: "jest-expo", setupFilesAfterEach: ["<rootDir>/jest.setup.ts"], transformIgnorePatterns: [ "node_modules/(?!(?:(jest-)?react-native|@react-native|expo(nent)?|@expo(nent)?/.*|" + "@expo-google-fonts/.*|react-navigation|@react-navigation/.*|" + "@cometchat/chat-uikit-react-native|@cometchat/chat-sdk-react-native|" + "@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)/)", ], moduleNameMapper: { "^@cometchat/chat-uikit-react-native$": "<rootDir>/__mocks__/cometchat-uikit.ts", "^@cometchat/chat-sdk-react-native$": "<rootDir>/__mocks__/cometchat-sdk.ts", }, }; ```
**`transformIgnorePatterns` matters.** By default Jest doesn't transform anything under `node_modules`, but CometChat ships ES module source. Without the pattern, Jest errors with `SyntaxError: Unexpected token 'export'`. The UI Kit + SDK names must be in the allow list.
---
## 4. Global setup — `jest.setup.ts`
```ts import "@testing-library/jest-native/extend-expect";
// Silence RN's "AnimatedValue" warning noise in tests jest.mock("react-native/Libraries/Animated/NativeAnimatedHelper");
// Mock native modules that the UI Kit pulls in jest.mock("react-native-gesture-handler", () => { const View = require("react-native/Libraries/Components/View/View"); return { GestureHandlerRootView: View, PanGestureHandler: View, TapGestureHandler: View, State: {}, Directions: {}, }; });
jest.mock("react-native-reanimated", () => require("react-native-reanimated/mock"), );
jest.mock("react-native-safe-area-context", () => ({ SafeAreaProvider: ({ children }: { children: React.ReactNode }) => children, SafeAreaView: ({ children }: { children: React.ReactNode }) => children, useSafeAreaInsets: () => ({ top: 0, right: 0, bottom: 0, left: 0 }), }));
// Silence console.warn from legacy components in tests — re-enable locally if debugging const originalWarn = console.warn; console.warn = (...args: unknown[]) => { if ( typeof args[0] === "string" && /componentWill|Unable to find|act\(\)/i.test(args[0]) ) { return; } originalWarn(...args); }; ```
---
## 5. Mocking the UI Kit
The UI Kit's top-level components (`CometChatConversations`, `CometChatMessageList`, etc.) wire socket listeners, call native modules, and render FlatLists with async data. Rendering them in Jest is more effort than value.
**Strategy: mock them as transparent Views that forward children.** This lets your tests verify your integration (are the right props being passed? does the right component mount in the right screen?) without pulling in the real implementation.
`__mocks__/cometchat-uikit.ts`: ```ts import React from "react"; import { View } from "react-native";
const passThrough = (name: string) => React.forwardRef<unknown, Record<string, unknown>>((props, ref) => { const { children, ...rest } = props as { children?: React.ReactNode }; return ( <View ref={ref as never} testID={name} {...rest}> {children} </View> ); });
export const CometChatUIKit = { init: jest.fn(async () => undefined), login: jest.fn(async () => ({ getUid: () => "cometchat-uid-1" })), logout: jest.fn(async () => undefined), getLoggedinUser: jest.fn(async () => ({ getUid: () => "cometchat-uid-1" })), };
export const UIKitSettingsBuilder = class { setAppId() { return this; } setRegion() { return this; } setAuthKey() { return this; } subscribePresenceForAllUsers() { return this; } build() { return {}; } };
export const CometChatThemeProvider = passThrough("CometChatThemeProvider"); export const CometChatI18nProvider = passThrough("CometChatI18nProvider"); export const CometChatConversations = passThrough("CometChatConversations"); export const CometChatMessageList = passThrough("CometChatMessageList"); export const CometChatMessageComposer = passThrough("CometChatMessageComposer"); export const CometChatMessageHeader = passThrough("CometChatMessageHeader"); export const CometChatUsers = passThrough("CometChatUsers"); export const CometChatGroups = passThrough("CometChatGroups"); export const CometChatIncomingCall = passThrough("CometChatIncomingCall"); export const CometChatOutgoingCall = passThrough("CometChatOutgoingCall");
export const CometChatUIEventHandler = { addUIListener: jest.fn(), removeListener: jest.fn(), }; export const CometChatUIEvents = {};
export const useTheme = () => ({ color: { primary: "#6852D6", background1: "#FFFFFF", textPrimary: "#141414", }, typography: { heading1: { fontFamily: "System", fontSize: 28 }, body1: { fontFamily: "System", fontSize: 16 }, }, }); ```
`__mocks__/cometchat-sdk.ts`: ```ts export const CometChat = { getUser: jest.fn(async (uid: string) => ({ getUid: () => uid, getName: () => "Test User" })), getGroup: jest.fn(async (guid: string) => ({ getGuid: () => guid, getName: () => "Test Group" })), addMessageListener: jest.fn(), removeMessageListener: jest.fn(), };
export const CometChatNotifications = { PushPlatforms: { FCM_REACT_NATIVE_ANDROID: "fcm-android", FCM_REACT_NATIVE_IOS: "fcm-ios", APNS_REACT_NATIVE_DEVICE: "apns-device", APNS_REACT_NATIVE_VOIP: "apns-voip", }, registerPushToken: jest.fn(async () => ({ success: true })), unregisterPushToken: jest.fn(async () => ({ success: true })), }; ```
Every real `<CometChatMessageList>` in your code renders as `<View testID="CometChatMessageList">` in tests. You can assert on `testID` + the props you passed.
---
## 6. Testing a custom component
Example — a custom chat screen that renders `<CometChatMessageList>` for a specific user:
```tsx // src/screens/MessagesScreen.tsx import { CometChat } from "@cometchat/chat-sdk-react-native"; import { CometChatMessageList } from "@cometchat/chat-uikit-react-native"; import { useEffect, useState } from "react";
export function MessagesScreen({ uid }: { uid: string }) { const [user, setUser] = useState<CometChat.User | null>(null);
useEffect(() => { CometChat.getUser(uid).then(setUser); }, [uid]);
if (!user) return null;
return <CometChatMessageList user={user} hideReplyInThreadOption />; } ```
Test: ```tsx // src/screens/__tests__/MessagesScreen.test.tsx import { render, waitFor } from "@testing-library/react-native"; import { CometChat } from "@cometchat/chat-sdk-react-native"; import { MessagesScreen } from "../MessagesScreen";
test("fetches user then renders MessageList", async () => { const { getByTestId, queryByTestId } = render(<MessagesScreen uid="alice" />);
// Before fetch resolves — nothing rendered expect(queryByTestId("CometChatMessageList")).toBeNull();
// After fetch resolves — list renders with user prop await waitFor(() => expect(getByTestId("CometChatMessageList")).toBeTruthy());
expect(CometChat.getUser).toHaveBeenCalledWith("alice"); });
test("passes hideReplyInThreadOption to MessageList", async () => { const { findByTestId } = render(<MessagesScreen uid="alice" />); const list = await findByTestId("CometChatMessageList");
// The mocked component stored props on the View — check them expect(list.props.hideReplyInThreadOption).toBe(true); }); ```
The second test is the valuable one — it guards the mandatory `hideReplyInThreadOption` flag (hard rule §4 in `cometchat-native-core`) against a future refactor dropping it.
---
## 7. Snapshot testing — use sparingly
**Do snapshot:** - Pure presentational components with no UI Kit dependency - Custom bubble renderers with fixed inputs - Data transforms (message → display string)
**Don't snapsh
Source provenance
Decision snapshot
recent repository activity
Audit
Install and adoption review
Agent-proven evidence
Outcome reports after resolve, review, install, and one narrow run.
No agent outcome data yet. The first agent run can report success, setup needs, risk blocks, failure, or not-relevant through /api/agent/outcome.
Install
Free and open source. Review the report before installing into production agents.
Growth loop
Scenario-led draft for cometchat-native-testing, ready for a manual X post.
cometchat-native-testing: Testing patterns for CometChat React Native — Jest + React Native Testing Library setup, mock... 100 stars https://www.openagentskill.com/skills/cometchat-cometchat-native-testing?ref=x
Listing + install path for cometchat-native-testing: https://www.openagentskill.com/skills/cometchat-cometchat-native-testing?ref=x Install: npx skills add cometchat/cometchat-skills --skill cometchat-native-testing
Listing source
This listing was indexed from public sources and is not marked official until a maintainer claim is approved.
Attribution links to the public repository or creator profile. Creators can claim the listing to update ownership signals.
Claim this skillOwner claim
This Registry indexed listing is attributed to cometchat but is not marked official yet. Claim it to add a verified owner signal and make future launch, install, and audit updates easier to trust.
Creator backlink kit
Show the canonical listing, current trust and audit signals, and real Agent-Proven evidence where developers evaluate the repository.
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-testing?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-testing?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-testing/audit)
[](https://www.openagentskill.com/skills/cometchat-cometchat-native-testing?ref=github&utm_source=github&utm_medium=referral&utm_campaign=creator_badge)cometchat
@cometchat
Share whether this skill looks useful for your agent workflow. Aggregated feedback improves rankings over time.
Sandbox only
Frontend Design
Guidance for distinctive, intentional UI design, typography, visual direction, and non-template-like product interfaces.
175.1K StarsTaste Skill: Anti-Slop Frontend
Design and implementation guidance for distinctive landing pages, portfolios, product demos, and purposeful redesigns.
85.2K StarsVox Director
Turn one topic into a narrated Vox-style paper-collage explainer or ad video, from script through captions.
1.8K StarsCanvas Design
Create original visual art, posters, PNG assets, and PDF documents through a clear design philosophy.
175.1K StarsPermission surface
secrets or environment access, shell or command execution
Agent outcomes
No agent outcome data yet
Docs
Strong README/SKILL.md context
Risk summary
Install readiness