[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6MF892EZSP2DGRBFTZYTN5X":3,"skill-same:01M6MF892EZSP2DGRBFTZYTN5X":80},{"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":23,"publishedAt":46,"linkOnly":47,"markdownContent":48,"markdownBody":49,"frontMatter":50,"refName":56,"commitSha":57,"skillDirectory":58,"forksCount":59,"repositoryHtmlUrl":60,"repositoryHomepageUrl":61,"ownerHtmlUrl":62,"ownerBlogUrl":63,"ownerDescription":64,"updatedAt":65,"install":66,"resources":79},"01M6MF892EZSP2DGRBFTZYTN5X","cometchat-angular-v5-testing",null,"Test an Angular app that embeds CometChat — what to mock vs exercise for real, TestBed setup for standalone kit components, avoiding real network in unit tests, and a two-account manual pass for realtime. Triggers: 'write tests for my chat', 'mock cometchat in jest', 'testbed cometchat', 'my tests hang', 'e2e test the chat'.","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-angular-v5-testing\u002FSKILL.md",[18],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"angular","cometchat angular v5 testing","testing","cometchat","e2e playwright","manual","for","vitest","angular testing","my","verified","network","write","jest","components","exercise","kit","write tests","e2e test","standalone","app","unit","2026-11-10 10:12:30",false,"---\nname: cometchat-angular-v5-testing\ndescription: \"Test an Angular app that embeds CometChat — what to mock vs exercise for real, TestBed setup for standalone kit components, avoiding real network in unit tests, and a two-account manual pass for realtime. Triggers: 'write tests for my chat', 'mock cometchat in jest', 'testbed cometchat', 'my tests hang', 'e2e test the chat'.\"\nlicense: \"MIT\"\ncompatibility: \"@cometchat\u002Fchat-uikit-angular ^5 (5.1.0–5.2.2 verified); Angular 17-21; Jest \u002F Karma \u002F Vitest \u002F Playwright\"\nmetadata:\n  author: \"CometChat\"\n  version: \"1.0.0\"\n  tags: \"cometchat angular testing v5 testbed jest mock e2e playwright\"\n---\n\n> **Ground truth:** `@cometchat\u002Fchat-uikit-angular@5` (5.1.0–5.2.2 verified). **The Angular UI Kit docs have no testing page** — the strategy here is the pack's own, and is labelled as such rather than presented as documented (a tracked DOCS GAP). Any kit symbol a test mocks must still exist in the `angular-v5` catalog, and its real shape comes from the component's `.md` twin via `cometchat-angular-v5-core\u002Freferences\u002Fdocs-map.md` — mock the API the kit actually exposes, never one invented to fit the test.\n\n## Companion skills (read first)\n- `cometchat-angular-v5-core` — init\u002Flogin lifecycle, which is what makes tests hang if unmocked.\n\n## Use this skill when\nWriting tests for a component that renders kit components, or diagnosing tests that hang or fail on network.\n\n## Decide what you are testing\n| Testing | Approach |\n| --- | --- |\n| **Your** logic — selection, routing, state | Unit test with CometChat **mocked** |\n| Kit component internals | Don't. It is a third-party dependency with its own tests |\n| Your app's chat flow end-to-end | Playwright against a real dev app, two accounts |\n| Realtime delivery | Manual, two browsers. Not automatable cheaply |\n\nThe common mistake is unit-testing kit internals. Test the seam: given a click, does your component set the right active chat?\n\n## Mock CometChat in unit tests\nKit components open sockets and call the API at construction. Left real, tests hang, fail offline, and pollute a live app with test data.\n\n```ts\n\u002F\u002F src\u002Ftesting\u002Fcometchat.mock.ts\nexport const cometChatUIKitMock = {\n  initFromSettings: jest.fn().mockResolvedValue({}),\n  login: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),\n  loginWithAuthToken: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),\n  logout: jest.fn().mockResolvedValue(undefined),\n  getLoggedInUser: jest.fn().mockReturnValue({ getUid: () => 'test-uid' }),\n  isInitialized: jest.fn().mockReturnValue(true),\n  isCallingEnabled: jest.fn().mockReturnValue(false),\n};\n```\nPoint the module at it (Jest):\n```ts\njest.mock('@cometchat\u002Fchat-uikit-angular', () => ({\n  ...jest.requireActual('@cometchat\u002Fchat-uikit-angular'),\n  CometChatUIKit: cometChatUIKitMock,\n}));\n```\nKeep `requireActual` so real component classes and `ChatStateService` still exist — you want your own wiring exercised, only the network faked.\n\n## TestBed with standalone kit components\nThey are standalone, so they go in `imports`, exactly as in the app:\n```ts\nimport { TestBed } from '@angular\u002Fcore\u002Ftesting';\nimport { ChatComponent } from '.\u002Fchat.component';\n\nbeforeEach(async () => {\n  await TestBed.configureTestingModule({ imports: [ChatComponent] }).compileComponents();\n});\n```\nIf a test fails with \"is not a known element\", the component under test is missing it from its own `imports` — a real bug the test just caught, not a test problem.\n\n## Prefer testing ChatStateService over the DOM\nAssert state, not kit markup. Kit internals change between releases; your wiring should not.\n```ts\nit('sets the active group when a group conversation is clicked', () => {\n  const fixture = TestBed.createComponent(ChatComponent);\n  const cmp = fixture.componentInstance;\n\n  \u002F\u002F Mock the SHAPE the kit actually emits: a Conversation whose subject is a Group.\n  \u002F\u002F Handing open() a bare { getGuid } instead lets a duck-typing bug pass the test\n  \u002F\u002F while every group chat throws \"getUid is not a function\" in the browser.\n  const group = new CometChat.Group('g1', 'Team', CometChat.GROUP_TYPE.PUBLIC);\n  const conversation = { getConversationType: () => 'group', getConversationWith: () => group };\n\n  cmp.open(conversation as unknown as CometChat.Conversation);\n  expect(cmp.chatState.getActiveGroup()).toBeTruthy();\n  expect(cmp.chatState.getActiveUser()).toBeFalsy();      \u002F\u002F the group must NOT land in the user slot\n});\n```\n> **Mock the emitted shape, not the shape your code happens to check.** A mock built backwards from the implementation can only confirm the implementation — including its bugs. `(itemClick)` emits a `Conversation`; a test that passes anything else is not exercising the wiring.\n\n## E2E with Playwright\nUse a real dev app and two seeded users. What is worth asserting:\n- The conversation list renders rows\n- Clicking one opens header + list + composer\n- Sending text makes it appear\n- **No console errors** — the kit fails quietly, so this catches a lot\n- **Nothing collapsed** — assert the message list's height is non-zero; a zero-height pane is the most common silent break\n\n```ts\nconst box = await page.locator('cometchat-message-list').boundingBox();\nexpect(box!.height).toBeGreaterThan(100);\n```\nSeed users and conversations through the REST API in setup, not the UI.\n\n## Not worth automating\nRealtime delivery between two clients, calls (needs media permissions and two peers), and push (needs a real device and a backgrounded app). Verify these manually and say so in the test plan rather than writing brittle automation.\n\n## Common pitfalls\n1. **Unmocked CometChat in unit tests** → hangs, flakes, offline failures.\n2. **Mocking the whole module** without `requireActual` → your own wiring never runs.\n3. **Asserting kit DOM internals** → breaks on every kit release.\n4. **Tests against a production app** → real users, real data.\n5. **No zero-height assertion in E2E** → the most common visual break goes unnoticed.\n6. **No teardown in tests** → leaked listeners bleed across specs.\n\n## Verify it works\nUnit tests pass offline · no test opens a real socket · a missing `imports` entry fails a test · E2E asserts non-zero height and no console errors · manual checks are documented, not faked.\n","> **Ground truth:** `@cometchat\u002Fchat-uikit-angular@5` (5.1.0–5.2.2 verified). **The Angular UI Kit docs have no testing page** — the strategy here is the pack's own, and is labelled as such rather than presented as documented (a tracked DOCS GAP). Any kit symbol a test mocks must still exist in the `angular-v5` catalog, and its real shape comes from the component's `.md` twin via `cometchat-angular-v5-core\u002Freferences\u002Fdocs-map.md` — mock the API the kit actually exposes, never one invented to fit the test.\n\n## Companion skills (read first)\n- `cometchat-angular-v5-core` — init\u002Flogin lifecycle, which is what makes tests hang if unmocked.\n\n## Use this skill when\nWriting tests for a component that renders kit components, or diagnosing tests that hang or fail on network.\n\n## Decide what you are testing\n| Testing | Approach |\n| --- | --- |\n| **Your** logic — selection, routing, state | Unit test with CometChat **mocked** |\n| Kit component internals | Don't. It is a third-party dependency with its own tests |\n| Your app's chat flow end-to-end | Playwright against a real dev app, two accounts |\n| Realtime delivery | Manual, two browsers. Not automatable cheaply |\n\nThe common mistake is unit-testing kit internals. Test the seam: given a click, does your component set the right active chat?\n\n## Mock CometChat in unit tests\nKit components open sockets and call the API at construction. Left real, tests hang, fail offline, and pollute a live app with test data.\n\n```ts\n\u002F\u002F src\u002Ftesting\u002Fcometchat.mock.ts\nexport const cometChatUIKitMock = {\n  initFromSettings: jest.fn().mockResolvedValue({}),\n  login: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),\n  loginWithAuthToken: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),\n  logout: jest.fn().mockResolvedValue(undefined),\n  getLoggedInUser: jest.fn().mockReturnValue({ getUid: () => 'test-uid' }),\n  isInitialized: jest.fn().mockReturnValue(true),\n  isCallingEnabled: jest.fn().mockReturnValue(false),\n};\n```\nPoint the module at it (Jest):\n```ts\njest.mock('@cometchat\u002Fchat-uikit-angular', () => ({\n  ...jest.requireActual('@cometchat\u002Fchat-uikit-angular'),\n  CometChatUIKit: cometChatUIKitMock,\n}));\n```\nKeep `requireActual` so real component classes and `ChatStateService` still exist — you want your own wiring exercised, only the network faked.\n\n## TestBed with standalone kit components\nThey are standalone, so they go in `imports`, exactly as in the app:\n```ts\nimport { TestBed } from '@angular\u002Fcore\u002Ftesting';\nimport { ChatComponent } from '.\u002Fchat.component';\n\nbeforeEach(async () => {\n  await TestBed.configureTestingModule({ imports: [ChatComponent] }).compileComponents();\n});\n```\nIf a test fails with \"is not a known element\", the component under test is missing it from its own `imports` — a real bug the test just caught, not a test problem.\n\n## Prefer testing ChatStateService over the DOM\nAssert state, not kit markup. Kit internals change between releases; your wiring should not.\n```ts\nit('sets the active group when a group conversation is clicked', () => {\n  const fixture = TestBed.createComponent(ChatComponent);\n  const cmp = fixture.componentInstance;\n\n  \u002F\u002F Mock the SHAPE the kit actually emits: a Conversation whose subject is a Group.\n  \u002F\u002F Handing open() a bare { getGuid } instead lets a duck-typing bug pass the test\n  \u002F\u002F while every group chat throws \"getUid is not a function\" in the browser.\n  const group = new CometChat.Group('g1', 'Team', CometChat.GROUP_TYPE.PUBLIC);\n  const conversation = { getConversationType: () => 'group', getConversationWith: () => group };\n\n  cmp.open(conversation as unknown as CometChat.Conversation);\n  expect(cmp.chatState.getActiveGroup()).toBeTruthy();\n  expect(cmp.chatState.getActiveUser()).toBeFalsy();      \u002F\u002F the group must NOT land in the user slot\n});\n```\n> **Mock the emitted shape, not the shape your code happens to check.** A mock built backwards from the implementation can only confirm the implementation — including its bugs. `(itemClick)` emits a `Conversation`; a test that passes anything else is not exercising the wiring.\n\n## E2E with Playwright\nUse a real dev app and two seeded users. What is worth asserting:\n- The conversation list renders rows\n- Clicking one opens header + list + composer\n- Sending text makes it appear\n- **No console errors** — the kit fails quietly, so this catches a lot\n- **Nothing collapsed** — assert the message list's height is non-zero; a zero-height pane is the most common silent break\n\n```ts\nconst box = await page.locator('cometchat-message-list').boundingBox();\nexpect(box!.height).toBeGreaterThan(100);\n```\nSeed users and conversations through the REST API in setup, not the UI.\n\n## Not worth automating\nRealtime delivery between two clients, calls (needs media permissions and two peers), and push (needs a real device and a backgrounded app). Verify these manually and say so in the test plan rather than writing brittle automation.\n\n## Common pitfalls\n1. **Unmocked CometChat in unit tests** → hangs, flakes, offline failures.\n2. **Mocking the whole module** without `requireActual` → your own wiring never runs.\n3. **Asserting kit DOM internals** → breaks on every kit release.\n4. **Tests against a production app** → real users, real data.\n5. **No zero-height assertion in E2E** → the most common visual break goes unnoticed.\n6. **No teardown in tests** → leaked listeners bleed across specs.\n\n## Verify it works\nUnit tests pass offline · no test opens a real socket · a missing `imports` entry fails a test · E2E asserts non-zero height and no console errors · manual checks are documented, not faked.\n",{"name":5,"license":15,"metadata":51,"description":7,"compatibility":55},{"tags":52,"author":53,"version":54},"cometchat angular testing v5 testbed jest mock e2e playwright","CometChat","1.0.0","@cometchat\u002Fchat-uikit-angular ^5 (5.1.0–5.2.2 verified); Angular 17-21; Jest \u002F Karma \u002F Vitest \u002F Playwright","main","cebc3dce495d7eb80d3b1d5841f877a4a92e162d","plugins\u002Fcometchat\u002Fcometchat-skills\u002Fskills\u002Fcometchat-angular-v5-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":67,"prompt":77,"zipAvailable":78},[68,71,74],{"tool":69,"command":70},"npx","npx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-angular-v5-testing",{"tool":72,"command":73},"bunx","bunx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-angular-v5-testing",{"tool":75,"command":76},"pnpm","pnpm dlx skills add hashgraph-online\u002Fawesome-codex-plugins --skill cometchat-angular-v5-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fhashgraph-online\u002Fawesome-codex-plugins\u002Fblob\u002Fmain\u002Fplugins\u002Fcometchat\u002Fcometchat-skills\u002Fskills\u002Fcometchat-angular-v5-testing\u002FSKILL.md",true,[],[81,90,98,106,114,122],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":85,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":89},"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":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":94,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":89},"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":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":102,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":89},"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":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":110,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":89},"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":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":118,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":89},"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":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":126,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":89},"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",[],[]]