/cometchat-skills:cometchat-flutter-v6-testingfrom cometchat-skills
Guides testing Flutter apps using CometChat UI Kit — what to test vs kit internals, mocking SDK boundary, widget tests for chat screens, and CI setup.
Ships in cometchat-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Ground truth: kit symbols are catalog-verified against 6.1.0. Test tooling (
flutter_test,integration_test,mocktail) is standard Flutter, not CometChat API.
cometchat-flutter-v6-core — install, credentials, init→login→render. This skill ASSUMES it.cometchat-flutter-v6-patterns — how init/login is gated, which is what your tests have to work around.The user ASKS for tests. Building a feature does not imply writing tests (RULES.md) — do not volunteer a test suite as part of "add chat".
flutter pub add --dev mocktail integration_test
flutter_test ships with Flutter.
Do not test the UI Kit. CometChatConversations rendering a list, CometChatMessageList appending a message, receipts, typing — all CometChat's own tested surface. Asserting on the kit's internals produces slow tests that break on every kit upgrade and prove nothing about YOUR app.
Test what is yours:
| Worth testing | Why |
|---|---|
| The init/login gate | Your logic. Does a chat route stay unreachable until login resolves? |
| Navigation wiring | onItemTap pushes the right screen with the right user/group. |
| Target plumbing | The thread screen receives parentMessageId and the same user/group — the silent-never-sends trap. |
| Config selection | Prod flavour has no Auth Key; the right App ID per flavour. |
| Your own slots | Custom listItemView / subtitleView widgets render as expected. |
| Error paths | onError surfaces something to the user instead of a blank screen. |
A CometChat widget expects an initialized, logged-in SDK. In a unit/widget test there is none, so:
// A seam: your screen depends on a builder, so tests substitute a stub for the kit widget.
import 'package:cometchat_chat_uikit/cometchat_chat_uikit.dart';
import 'package:flutter/material.dart';
typedef ConversationsBuilder = Widget Function(void Function(Conversation) onTap);
class ChatsScreen extends StatelessWidget {
final ConversationsBuilder builder;
final void Function(Conversation) onOpen;
const ChatsScreen({super.key, required this.builder, required this.onOpen});
@override
Widget build(BuildContext context) => Scaffold(body: SafeArea(child: builder(onOpen)));
}
// production wiring
Widget realConversations(void Function(Conversation) onTap) =>
CometChatConversations(onItemTap: onTap);
In the test, pass a builder returning a plain ListView and assert that tapping a row calls onOpen with the right conversation — that is YOUR logic, tested fast and without a network.
integration_test)The only place a real end-to-end chat flow can be asserted, because it needs a real init/login.
cometchat-uid-1...), never production data.Run flutter analyze + unit/widget tests on every PR — they need no credentials. Gate integration tests behind a job that has the test-app secrets, and let them be non-blocking if the environment is flaky; a red build from a missing fixture teaches people to ignore CI.
RULES.md).init/login → hangs or throws; gate it behind the seam.Unit/widget tests run with no network and no credentials; integration tests pass against the test app; flutter analyze is clean; nothing in the suite asserts on CometChat's internal rendering.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cometchat, flutter-testing, widget-test, mocking, integration-test
npx claudepluginhub cometchat/cometchat-skills --plugin cometchat-skills98 skills in this plugin
/cometchatEntry point for any CometChat task on any platform. Detects the framework + UI Kit version (React, Angular, iOS, Android, React Native, Flutter), then routes to that family's skills — for a NEW integration or a change to an existing one. Triggers: 'add chat', 'add cometchat', 'add chat to my app', 'add calling', 'change something in my chat', 'my chat is already set up', 'add a feature to the chat', 'add chat to my android app', 'integrate cometchat android', 'add chat to my ios app', 'integrate cometchat ios', 'add chat to my swift app', 'migrate my app to cometchat', 'migrate from sendbird', 'migrate from getstream / stream', 'replace sendbird / stream chat with cometchat', 'build a <app> clone', 'make a chat app like <app>', 'make it look and work like <app>'./cometchat-a11yKeep a CometChat integration accessible — the UI Kit is designed targeting WCAG 2.1 AA with keyboard navigation (verify per component in its docs; full conformance still needs manual testing), and this skill makes sure the HOST app doesn't break that, covering contrast, focus, screen-reader context, reduced motion, RTL, and calls accessibility. Cross-family. Triggers: 'is cometchat accessible', 'WCAG / 508 / ADA compliance', 'screen reader support', 'keyboard navigation', 'a11y audit', 'accessible chat', 'contrast/focus issues in chat'.Other plugins' skills for the same job