Cometchat Angular V5 Testing logo

Cometchat Angular V5 Testing

Organization
cometchat
cometchat-angular-v5-testing

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'.

Overview

Publishercometchat
Repositorycometchat-skills
Skill namecometchat-angular-v5-testing
Stars
109
Forks
2
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by cometchat on GitHub. Read the source before you install it.

Installation

Install the Cometchat Angular V5 Testing AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/cometchat/cometchat-skills.git /tmp/cometchat-skills
mkdir -p .claude/skills
cp -r /tmp/cometchat-skills/skills/cometchat-angular-v5-testing .claude/skills/cometchat-angular-v5-testing
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Cometchat Angular V5 Testing in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Cometchat Angular V5 Testing on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Cometchat Angular V5 Testing is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Ground truth: @cometchat/chat-uikit-angular@5 (5.1.0–5.2.0 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/references/docs-map.md — mock the API the kit actually exposes, never one invented to fit the test.

Companion skills (read first)

  • cometchat-angular-v5-core — init/login lifecycle, which is what makes tests hang if unmocked.

Use this skill when

Writing tests for a component that renders kit components, or diagnosing tests that hang or fail on network.

Decide what you are testing

TestingApproach
Your logic — selection, routing, stateUnit test with CometChat mocked
Kit component internalsDon't. It is a third-party dependency with its own tests
Your app's chat flow end-to-endPlaywright against a real dev app, two accounts
Realtime deliveryManual, two browsers. Not automatable cheaply

The common mistake is unit-testing kit internals. Test the seam: given a click, does your component set the right active chat?

Mock CometChat in unit tests

Kit components open sockets and call the API at construction. Left real, tests hang, fail offline, and pollute a live app with test data.

ts
// src/testing/cometchat.mock.ts
export const cometChatUIKitMock = {
  initFromSettings: jest.fn().mockResolvedValue({}),
  login: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),
  loginWithAuthToken: jest.fn().mockResolvedValue({ getUid: () => 'test-uid' }),
  logout: jest.fn().mockResolvedValue(undefined),
  getLoggedInUser: jest.fn().mockReturnValue({ getUid: () => 'test-uid' }),
  isInitialized: jest.fn().mockReturnValue(true),
  isCallingEnabled: jest.fn().mockReturnValue(false),
};

Point the module at it (Jest):

ts
jest.mock('@cometchat/chat-uikit-angular', () => ({
  ...jest.requireActual('@cometchat/chat-uikit-angular'),
  CometChatUIKit: cometChatUIKitMock,
}));

Keep requireActual so real component classes and ChatStateService still exist — you want your own wiring exercised, only the network faked.

TestBed with standalone kit components

They are standalone, so they go in imports, exactly as in the app:

ts
import { TestBed } from '@angular/core/testing';
import { ChatComponent } from './chat.component';

beforeEach(async () => {
  await TestBed.configureTestingModule({ imports: [ChatComponent] }).compileComponents();
});

If 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.

Prefer testing ChatStateService over the DOM

Assert state, not kit markup. Kit internals change between releases; your wiring should not.

ts
it('sets the active group when a group conversation is clicked', () => {
  const fixture = TestBed.createComponent(ChatComponent);
  const cmp = fixture.componentInstance;

  // Mock the SHAPE the kit actually emits: a Conversation whose subject is a Group.
  // Handing open() a bare { getGuid } instead lets a duck-typing bug pass the test
  // while every group chat throws "getUid is not a function" in the browser.
  const group = new CometChat.Group('g1', 'Team', CometChat.GROUP_TYPE.PUBLIC);
  const conversation = { getConversationType: () => 'group', getConversationWith: () => group };

  cmp.open(conversation as unknown as CometChat.Conversation);
  expect(cmp.chatState.getActiveGroup()).toBeTruthy();
  expect(cmp.chatState.getActiveUser()).toBeFalsy();      // the group must NOT land in the user slot
});

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.

E2E with Playwright

Use a real dev app and two seeded users. What is worth asserting:

  • The conversation list renders rows
  • Clicking one opens header + list + composer
  • Sending text makes it appear
  • No console errors — the kit fails quietly, so this catches a lot
  • Nothing collapsed — assert the message list's height is non-zero; a zero-height pane is the most common silent break
ts
const box = await page.locator('cometchat-message-list').boundingBox();
expect(box!.height).toBeGreaterThan(100);

Seed users and conversations through the REST API in setup, not the UI.

Not worth automating

Realtime 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.

Common pitfalls

  1. Unmocked CometChat in unit tests → hangs, flakes, offline failures.
  2. Mocking the whole module without requireActual → your own wiring never runs.
  3. Asserting kit DOM internals → breaks on every kit release.
  4. Tests against a production app → real users, real data.
  5. No zero-height assertion in E2E → the most common visual break goes unnoticed.
  6. No teardown in tests → leaked listeners bleed across specs.

Verify it works

Unit 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.

Frequently asked questions

What does the Cometchat Angular V5 Testing AI skill do?

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'.

Why use Cometchat Angular V5 Testing on TypingMind?

Because you install it once and use it with any model. Cometchat Angular V5 Testing is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Cometchat Angular V5 Testing in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cometchat/cometchat-skills/tree/main/skills/cometchat-angular-v5-testing. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Cometchat Angular V5 Testing?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Cometchat Angular V5 Testing?

As many as you like. As long as a model supports skills, you can use Cometchat Angular V5 Testing with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Cometchat Angular V5 Testing AI skill free?

Yes. It is published on GitHub by cometchat under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇