[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MFM70V6KJKMYQDHR4AX48P":3,"skill-same:01M6MFM70V6KJKMYQDHR4AX48P":82},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":26,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":58,"commitSha":59,"skillDirectory":60,"forksCount":61,"repositoryHtmlUrl":62,"repositoryHomepageUrl":63,"ownerHtmlUrl":64,"ownerBlogUrl":65,"ownerDescription":66,"updatedAt":67,"install":68,"resources":81},"01M6MFM70V6KJKMYQDHR4AX48P","cometchat-react-v7-testing",null,"Test a React app that embeds CometChat v7 — what to mock vs exercise for real, rendering kit components under a test provider, waiting out the async init→login gate, and a lean E2E smoke. Triggers: 'test my cometchat react app', 'mock cometchat in jest\u002Fvitest', 'unit test chat component', 'playwright test for chat', 'how do I test cometchat'.","hashgraph-online\u002Fawesome-codex-plugins","hashgraph-online","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F160371962?v=4","01M6CNB6NRJVNNGN14TR01Q6D3","HOL (Hashgraph Online)","01M6JT1HSKKG9V68KQAQGBA7XP",1575,"MIT","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fcometchat\u002Fcometchat-skills\u002Fskills\u002Fcometchat-react-v7-testing\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000009","前端开发",[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"cometchat","react","cometchat react v7 testing","testing","jest","unit test","verified","login","my","kit","rendering","unit","app","react testing","lean","how","exercise","testing library","init","component","components","2026-11-10 10:12:30",false,"---\nname: cometchat-react-v7-testing\ndescription: \"Test a React app that embeds CometChat v7 — what to mock vs exercise for real, rendering kit components under a test provider, waiting out the async init→login gate, and a lean E2E smoke. Triggers: 'test my cometchat react app', 'mock cometchat in jest\u002Fvitest', 'unit test chat component', 'playwright test for chat', 'how do I test cometchat'.\"\nlicense: \"MIT\"\ncompatibility: \"@cometchat\u002Fchat-uikit-react ^7 (7.1.x–7.2.x verified); React 18–19; Vitest \u002F Jest \u002F React Testing Library \u002F Playwright\"\nmetadata:\n  author: \"CometChat\"\n  version: \"1.0.0\"\n  tags: \"cometchat react v7 testing vitest jest playwright mock rtl\"\n---\n\n> **Ground truth:** `@cometchat\u002Fchat-uikit-react@7`. Component\u002Fmethod names come from `cometchat-react-v7-core` + its catalog; signatures are FETCHED via `cometchat-react-v7-core\u002Freferences\u002Fdocs-map.md`. **The UI Kit docs have no dedicated testing page** — this is the pack's own guidance (tracked DOCS GAP). Never assert against kit-internal DOM classes; they are not a public contract.\n\n## Companion skills (read first)\n- `cometchat-react-v7-core` — the init→login→render lifecycle these tests exercise.\n\n## Use this skill when\nAdding tests around a CometChat integration, or a \"how do I test this\" question. NOT part of a normal build — only when tests are explicitly asked for (`RULES.md` → Verification scope).\n\n## Decide what you are testing\nYou are testing **your** code, not CometChat's kit. Three layers:\n- **Your logic** (token fetch, UID mapping, routing, state) → unit-test in isolation, **mock the SDK**.\n- **Your wiring** (does the surface mount after init+login, are the right props passed) → render under a test provider with the SDK mocked.\n- **The real round-trip** (send → receive) → a thin E2E against a test app, not a unit test.\n\nDo not unit-test that `CometChatMessageList` renders messages — that is the kit's own test surface.\n\n## Mock the SDK in unit tests\nMock the two entry modules so nothing hits the network and no real login is attempted:\n```tsx\nvi.mock(\"@cometchat\u002Fchat-sdk-javascript\", () => ({ CometChat: { getLoggedinUser: vi.fn().mockResolvedValue(null) } }));\nvi.mock(\"@cometchat\u002Fchat-uikit-react\", async (orig) => ({\n  ...(await orig()),\n  CometChatUIKit: { initFromSettings: vi.fn().mockResolvedValue(null), getLoggedInUser: vi.fn().mockReturnValue(null), login: vi.fn().mockResolvedValue({ getUid: () => \"u1\" }), loginWithAuthToken: vi.fn().mockResolvedValue({ getUid: () => \"u1\" }), logout: vi.fn().mockResolvedValue(undefined) },\n}));\n```\n(Jest: swap `vi` for `jest`.) Now assert your own token-fetch and error handling without a backend.\n\n## Render the surface under test\nThe kit surface mounts only **after** init+login resolve. Tests must await that gate, not assert synchronously:\n```tsx\nrender(\u003CApp \u002F>);\nexpect(await screen.findByText(\u002Fsign in|loading|chats\u002Fi)).toBeInTheDocument();\n```\nPrefer `findBy*` (async) over `getBy*`; a synchronous query runs before the init promise settles and fails intermittently. Wrap the surface in `CometChatErrorBoundary` in the app so a thrown error surfaces as a testable fallback, not an unhandled rejection.\n\n## E2E smoke (Playwright)\nOne high-value path against a **real test app** (seeded users, dev Auth Key in a test-only env): load the app, sign in, assert the conversation list renders with real height and a message can be sent. Assert on **your** visible text\u002Froles and the presence of the mounted surface — not on kit BEM classes. Keep it to the happy path plus one auth-failure path; the kit's internals are already tested upstream.\n\n## Not worth automating\nKit component internals, exhaustive prop matrices, live calls\u002Fpush (device-dependent), and pixel snapshots of kit UI (they churn across minor kit versions). Spend the budget on your token flow, UID mapping, and the init-gate wiring.\n\n## Common pitfalls\n1. **Synchronous assertions before init resolves** — flaky; use `findBy*`\u002F`waitFor`.\n2. **Asserting on kit DOM classes** — they change across versions; assert your own markup + roles.\n3. **A real login in unit tests** — mock `CometChatUIKit`; never ship a test Auth Key to prod env files.\n4. **StrictMode double-invoke** — mocks must be idempotent (return the same resolved user), mirroring the app's in-flight guard.\n\n## Verify it works\nUnit tests pass with the SDK mocked (no network) · the surface test awaits the init gate and finds the mounted UI · the E2E smoke signs in and renders conversations against a test app · no test asserts a kit-internal class.\n","> **Ground truth:** `@cometchat\u002Fchat-uikit-react@7`. Component\u002Fmethod names come from `cometchat-react-v7-core` + its catalog; signatures are FETCHED via `cometchat-react-v7-core\u002Freferences\u002Fdocs-map.md`. **The UI Kit docs have no dedicated testing page** — this is the pack's own guidance (tracked DOCS GAP). Never assert against kit-internal DOM classes; they are not a public contract.\n\n## Companion skills (read first)\n- `cometchat-react-v7-core` — the init→login→render lifecycle these tests exercise.\n\n## Use this skill when\nAdding tests around a CometChat integration, or a \"how do I test this\" question. NOT part of a normal build — only when tests are explicitly asked for (`RULES.md` → Verification scope).\n\n## Decide what you are testing\nYou are testing **your** code, not CometChat's kit. Three layers:\n- **Your logic** (token fetch, UID mapping, routing, state) → unit-test in isolation, **mock the SDK**.\n- **Your wiring** (does the surface mount after init+login, are the right props passed) → render under a test provider with the SDK mocked.\n- **The real round-trip** (send → receive) → a thin E2E against a test app, not a unit test.\n\nDo not unit-test that `CometChatMessageList` renders messages — that is the kit's own test surface.\n\n## Mock the SDK in unit tests\nMock the two entry modules so nothing hits the network and no real login is attempted:\n```tsx\nvi.mock(\"@cometchat\u002Fchat-sdk-javascript\", () => ({ CometChat: { getLoggedinUser: vi.fn().mockResolvedValue(null) } }));\nvi.mock(\"@cometchat\u002Fchat-uikit-react\", async (orig) => ({\n  ...(await orig()),\n  CometChatUIKit: { initFromSettings: vi.fn().mockResolvedValue(null), getLoggedInUser: vi.fn().mockReturnValue(null), login: vi.fn().mockResolvedValue({ getUid: () => \"u1\" }), loginWithAuthToken: vi.fn().mockResolvedValue({ getUid: () => \"u1\" }), logout: vi.fn().mockResolvedValue(undefined) },\n}));\n```\n(Jest: swap `vi` for `jest`.) Now assert your own token-fetch and error handling without a backend.\n\n## Render the surface under test\nThe kit surface mounts only **after** init+login resolve. Tests must await that gate, not assert synchronously:\n```tsx\nrender(\u003CApp \u002F>);\nexpect(await screen.findByText(\u002Fsign in|loading|chats\u002Fi)).toBeInTheDocument();\n```\nPrefer `findBy*` (async) over `getBy*`; a synchronous query runs before the init promise settles and fails intermittently. Wrap the surface in `CometChatErrorBoundary` in the app so a thrown error surfaces as a testable fallback, not an unhandled rejection.\n\n## E2E smoke (Playwright)\nOne high-value path against a **real test app** (seeded users, dev Auth Key in a test-only env): load the app, sign in, assert the conversation list renders with real height and a message can be sent. Assert on **your** visible text\u002Froles and the presence of the mounted surface — not on kit BEM classes. Keep it to the happy path plus one auth-failure path; the kit's internals are already tested upstream.\n\n## Not worth automating\nKit component internals, exhaustive prop matrices, live calls\u002Fpush (device-dependent), and pixel snapshots of kit UI (they churn across minor kit versions). Spend the budget on your token flow, UID mapping, and the init-gate wiring.\n\n## Common pitfalls\n1. **Synchronous assertions before init resolves** — flaky; use `findBy*`\u002F`waitFor`.\n2. **Asserting on kit DOM classes** — they change across versions; assert your own markup + roles.\n3. **A real login in unit tests** — mock `CometChatUIKit`; never ship a test Auth Key to prod env files.\n4. **StrictMode double-invoke** — mocks must be idempotent (return the same resolved user), mirroring the app's in-flight guard.\n\n## Verify it works\nUnit tests pass with the SDK mocked (no network) · the surface test awaits the init gate and finds the mounted UI · the E2E smoke signs in and renders conversations against a test app · no test asserts a kit-internal class.\n",{"name":5,"license":15,"metadata":53,"description":7,"compatibility":57},{"tags":54,"author":55,"version":56},"cometchat react v7 testing vitest jest playwright mock rtl","CometChat","1.0.0","@cometchat\u002Fchat-uikit-react ^7 (7.1.x–7.2.x verified); React 18–19; Vitest \u002F Jest \u002F React Testing Library \u002F Playwright","main","2b63f856ce19c2a797929cacabd9e0fc936812fa","plugins\u002Fcometchat\u002Fcometchat-skills\u002Fskills\u002Fcometchat-react-v7-testing",491,"https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins","https:\u002F\u002Fhol.org\u002Fplugins\u002Fbest-codex-plugins","https:\u002F\u002Fgithub.com\u002Fhashgraph-online","https:\u002F\u002Fhol.org","Open-source standards and developer tools for interoperable AI agents: discovery, identity, communication, payments, privacy and security.","2026-11-14 14:06:13",{"source":8,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-react-v7-testing",{"tool":74,"command":75},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-react-v7-testing",{"tool":77,"command":78},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-react-v7-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fcometchat\u002Fcometchat-skills\u002Fskills\u002Fcometchat-react-v7-testing\u002FSKILL.md",true,[],[83,92,100,108,116,124],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":87,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":91},"01M7DV332YQMGD8WTRJ9DZQXTB","worktable-review-with-annotations","Create, inspect, reply to, update, or resolve situated Worktable annotations. Use when feedback belongs to a Doc section, block, text range, or HTML Doc, or when the user asks to address existing review feedback and coordinate a requested artifact edit.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-review-with-annotations\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":96,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":91},"01M7DV2YGHCZVBEB1AHYB6CGHE","worktable-find-and-synthesize-context","Find, assess, and synthesize context from Worktable Docs and Records. Use when the user asks what a workspace contains, wants workspace-backed research, needs current facts reconciled across artifacts, or requests a cited synthesis without changing workspace state.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-find-and-synthesize-context\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":104,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":91},"01M7DV2TQN1H11ME2SAF9MXN7V","worktable-create-or-update-docs","Create, edit, rename, or maintain narrative Worktable Docs. Use for plans, decisions, briefs, notes, research syntheses, and other durable prose when the user requests a new artifact or a safe update to an existing one.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-update-docs\u002FSKILL.md",[],[],{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":112,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":91},"01M7DV2NE452NEA8TXATKSNAJH","worktable-create-or-manage-records","Organize repeated structured information as durable Worktable Records. Use for research datasets, inventories, directories, pipelines, trackers, and other collections whose items need identity, fields, filtering, links, validation, or individual updates.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-records\u002FSKILL.md",[],[],{"skillNo":117,"name":118,"nameZh":6,"description":119,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":120,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":91},"01M7DV2HENRBR2KSCVM064WH0Y","worktable-create-or-manage-interactive-html","Create or improve durable visual and interactive artifacts in Worktable. Use for dashboards, trackers, calculators, mini apps, slide presentations, and other requests that benefit from a polished HTML Doc.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-create-or-manage-interactive-html\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":128,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":91},"01M7DV2CADR5R7RQFFYPNAGR9Y","worktable-collaborate-threads","Read, answer, and hand off messages through durable Worktable threads with users or other authenticated participants. Use when the user asks to check addressed messages, reply to a participant, continue a thread, request another agent's help, wait briefly for a response, or watch for comments and messages sent to the agent.","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fworktable\u002Fworktable-plugin\u002Fskills\u002Fworktable-collaborate-threads\u002FSKILL.md",[],[]]