@cometchat/skills 4.1.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (257) hide show
  1. package/bin/install.js +298 -41
  2. package/package.json +1 -1
  3. package/skills/cometchat/SKILL.md +146 -27
  4. package/skills/cometchat-a11y/SKILL.md +476 -0
  5. package/skills/cometchat-android-v5/SKILL.md +1 -1
  6. package/skills/cometchat-android-v5-calls/SKILL.md +413 -0
  7. package/skills/cometchat-android-v5-calls/references/README.md +53 -0
  8. package/skills/cometchat-android-v5-calls/references/add-calls-to-existing-chat.md +195 -0
  9. package/skills/cometchat-android-v5-calls/references/audio-controls.md +91 -0
  10. package/skills/cometchat-android-v5-calls/references/background-handling.md +168 -0
  11. package/skills/cometchat-android-v5-calls/references/call-layouts.md +123 -0
  12. package/skills/cometchat-android-v5-calls/references/call-logs.md +113 -0
  13. package/skills/cometchat-android-v5-calls/references/call-session.md +274 -0
  14. package/skills/cometchat-android-v5-calls/references/custom-ui.md +150 -0
  15. package/skills/cometchat-android-v5-calls/references/event-listeners.md +123 -0
  16. package/skills/cometchat-android-v5-calls/references/group-calls.md +205 -0
  17. package/skills/cometchat-android-v5-calls/references/idle-timeout.md +111 -0
  18. package/skills/cometchat-android-v5-calls/references/in-call-chat.md +134 -0
  19. package/skills/cometchat-android-v5-calls/references/join-session.md +120 -0
  20. package/skills/cometchat-android-v5-calls/references/migration-v4-to-v5.md +206 -0
  21. package/skills/cometchat-android-v5-calls/references/participant-management.md +110 -0
  22. package/skills/cometchat-android-v5-calls/references/picture-in-picture.md +106 -0
  23. package/skills/cometchat-android-v5-calls/references/raise-hand.md +242 -0
  24. package/skills/cometchat-android-v5-calls/references/recording.md +101 -0
  25. package/skills/cometchat-android-v5-calls/references/ringing-integration.md +152 -0
  26. package/skills/cometchat-android-v5-calls/references/screen-sharing.md +82 -0
  27. package/skills/cometchat-android-v5-calls/references/server-fcm-voip.md +215 -0
  28. package/skills/cometchat-android-v5-calls/references/session-settings.md +121 -0
  29. package/skills/cometchat-android-v5-calls/references/setup.md +137 -0
  30. package/skills/cometchat-android-v5-calls/references/share-invite.md +151 -0
  31. package/skills/cometchat-android-v5-calls/references/video-controls.md +87 -0
  32. package/skills/cometchat-android-v5-calls/references/voip-calling.md +526 -0
  33. package/skills/cometchat-android-v5-components/SKILL.md +1 -1
  34. package/skills/cometchat-android-v5-core/SKILL.md +1 -1
  35. package/skills/cometchat-android-v5-customization/SKILL.md +1 -1
  36. package/skills/cometchat-android-v5-extensions/SKILL.md +1 -1
  37. package/skills/cometchat-android-v5-features/SKILL.md +1 -1
  38. package/skills/cometchat-android-v5-placement/SKILL.md +1 -1
  39. package/skills/cometchat-android-v5-production/SKILL.md +1 -1
  40. package/skills/cometchat-android-v5-push/SKILL.md +1 -1
  41. package/skills/cometchat-android-v5-testing/SKILL.md +1 -1
  42. package/skills/cometchat-android-v5-theming/SKILL.md +1 -1
  43. package/skills/cometchat-android-v5-troubleshooting/SKILL.md +1 -1
  44. package/skills/cometchat-android-v6/SKILL.md +1 -1
  45. package/skills/cometchat-android-v6-builder-settings/SKILL.md +1 -1
  46. package/skills/cometchat-android-v6-calls/SKILL.md +375 -0
  47. package/skills/cometchat-android-v6-calls/references/add-calls-to-existing-chat.md +97 -0
  48. package/skills/cometchat-android-v6-calls/references/call-layouts.md +91 -0
  49. package/skills/cometchat-android-v6-calls/references/call-session.md +163 -0
  50. package/skills/cometchat-android-v6-calls/references/device-management.md +171 -0
  51. package/skills/cometchat-android-v6-calls/references/group-calls.md +191 -0
  52. package/skills/cometchat-android-v6-calls/references/idle-timeout.md +107 -0
  53. package/skills/cometchat-android-v6-calls/references/in-call-chat.md +136 -0
  54. package/skills/cometchat-android-v6-calls/references/raise-hand.md +186 -0
  55. package/skills/cometchat-android-v6-calls/references/ringing-integration.md +176 -0
  56. package/skills/cometchat-android-v6-calls/references/server-fcm-voip.md +127 -0
  57. package/skills/cometchat-android-v6-calls/references/share-invite.md +105 -0
  58. package/skills/cometchat-android-v6-compose-components/SKILL.md +2 -2
  59. package/skills/cometchat-android-v6-compose-customization/SKILL.md +1 -1
  60. package/skills/cometchat-android-v6-compose-placement/SKILL.md +1 -1
  61. package/skills/cometchat-android-v6-compose-theming/SKILL.md +1 -1
  62. package/skills/cometchat-android-v6-core/SKILL.md +1 -1
  63. package/skills/cometchat-android-v6-events/SKILL.md +1 -1
  64. package/skills/cometchat-android-v6-extensions/SKILL.md +1 -1
  65. package/skills/cometchat-android-v6-features/SKILL.md +1 -1
  66. package/skills/cometchat-android-v6-kotlin-components/SKILL.md +1 -1
  67. package/skills/cometchat-android-v6-kotlin-customization/SKILL.md +1 -1
  68. package/skills/cometchat-android-v6-kotlin-placement/SKILL.md +1 -1
  69. package/skills/cometchat-android-v6-kotlin-theming/SKILL.md +1 -1
  70. package/skills/cometchat-android-v6-migration/SKILL.md +398 -0
  71. package/skills/cometchat-android-v6-production/SKILL.md +1 -1
  72. package/skills/cometchat-android-v6-push/SKILL.md +1 -1
  73. package/skills/cometchat-android-v6-testing/SKILL.md +1 -1
  74. package/skills/cometchat-android-v6-troubleshooting/SKILL.md +1 -1
  75. package/skills/cometchat-angular-calls/SKILL.md +511 -0
  76. package/skills/cometchat-angular-calls/references/add-calls-to-existing-chat.md +95 -0
  77. package/skills/cometchat-angular-calls/references/call-layouts.md +106 -0
  78. package/skills/cometchat-angular-calls/references/call-session.md +167 -0
  79. package/skills/cometchat-angular-calls/references/custom-ui.md +231 -0
  80. package/skills/cometchat-angular-calls/references/device-management.md +135 -0
  81. package/skills/cometchat-angular-calls/references/group-calls.md +412 -0
  82. package/skills/cometchat-angular-calls/references/idle-timeout.md +145 -0
  83. package/skills/cometchat-angular-calls/references/in-call-chat.md +148 -0
  84. package/skills/cometchat-angular-calls/references/lazy-loading-pitfalls.md +205 -0
  85. package/skills/cometchat-angular-calls/references/migration-v4-to-v5.md +53 -0
  86. package/skills/cometchat-angular-calls/references/ngzone-and-async-callbacks.md +183 -0
  87. package/skills/cometchat-angular-calls/references/picture-in-picture.md +285 -0
  88. package/skills/cometchat-angular-calls/references/raise-hand.md +167 -0
  89. package/skills/cometchat-angular-calls/references/recording-screen-share.md +267 -0
  90. package/skills/cometchat-angular-calls/references/ringing-integration.md +131 -0
  91. package/skills/cometchat-angular-calls/references/server-web-push-vapid.md +100 -0
  92. package/skills/cometchat-angular-calls/references/share-invite.md +116 -0
  93. package/skills/cometchat-angular-components/SKILL.md +1 -1
  94. package/skills/cometchat-angular-core/SKILL.md +1 -1
  95. package/skills/cometchat-angular-customization/SKILL.md +1 -1
  96. package/skills/cometchat-angular-features/SKILL.md +1 -1
  97. package/skills/cometchat-angular-patterns/SKILL.md +1 -1
  98. package/skills/cometchat-angular-placement/SKILL.md +1 -1
  99. package/skills/cometchat-angular-production/SKILL.md +1 -1
  100. package/skills/cometchat-angular-push/SKILL.md +403 -0
  101. package/skills/cometchat-angular-testing/SKILL.md +333 -0
  102. package/skills/cometchat-angular-theming/SKILL.md +1 -1
  103. package/skills/cometchat-angular-troubleshooting/SKILL.md +1 -1
  104. package/skills/cometchat-astro-patterns/SKILL.md +1 -1
  105. package/skills/cometchat-calls/SKILL.md +358 -0
  106. package/skills/cometchat-calls/references/use-case-broadcast.md +194 -0
  107. package/skills/cometchat-calls/references/use-case-marketplace.md +158 -0
  108. package/skills/cometchat-calls/references/use-case-support.md +190 -0
  109. package/skills/cometchat-calls/references/use-case-team.md +169 -0
  110. package/skills/cometchat-calls/references/use-case-telehealth.md +154 -0
  111. package/skills/cometchat-components/SKILL.md +1 -1
  112. package/skills/cometchat-core/SKILL.md +1 -1
  113. package/skills/cometchat-customization/SKILL.md +2 -2
  114. package/skills/cometchat-features/SKILL.md +2 -2
  115. package/skills/cometchat-flutter-v5/SKILL.md +1 -1
  116. package/skills/cometchat-flutter-v5-calls/SKILL.md +325 -94
  117. package/skills/cometchat-flutter-v5-calls/references/add-calls-to-existing-chat.md +169 -0
  118. package/skills/cometchat-flutter-v5-calls/references/call-layouts.md +98 -0
  119. package/skills/cometchat-flutter-v5-calls/references/call-session.md +330 -0
  120. package/skills/cometchat-flutter-v5-calls/references/device-management.md +120 -0
  121. package/skills/cometchat-flutter-v5-calls/references/group-calls.md +187 -0
  122. package/skills/cometchat-flutter-v5-calls/references/idle-timeout.md +97 -0
  123. package/skills/cometchat-flutter-v5-calls/references/in-call-chat.md +132 -0
  124. package/skills/cometchat-flutter-v5-calls/references/migration-v4-to-v5.md +160 -0
  125. package/skills/cometchat-flutter-v5-calls/references/raise-hand.md +244 -0
  126. package/skills/cometchat-flutter-v5-calls/references/ringing-integration.md +193 -0
  127. package/skills/cometchat-flutter-v5-calls/references/server-push-bridge.md +101 -0
  128. package/skills/cometchat-flutter-v5-calls/references/share-invite.md +142 -0
  129. package/skills/cometchat-flutter-v5-conversations/SKILL.md +1 -1
  130. package/skills/cometchat-flutter-v5-core/SKILL.md +1 -1
  131. package/skills/cometchat-flutter-v5-customization/SKILL.md +1 -1
  132. package/skills/cometchat-flutter-v5-events/SKILL.md +1 -1
  133. package/skills/cometchat-flutter-v5-messages/SKILL.md +1 -1
  134. package/skills/cometchat-flutter-v5-production/SKILL.md +1 -1
  135. package/skills/cometchat-flutter-v5-push/SKILL.md +1 -1
  136. package/skills/cometchat-flutter-v5-testing/SKILL.md +390 -0
  137. package/skills/cometchat-flutter-v5-theming/SKILL.md +1 -1
  138. package/skills/cometchat-flutter-v5-troubleshooting/SKILL.md +1 -1
  139. package/skills/cometchat-flutter-v5-users-groups/SKILL.md +1 -1
  140. package/skills/cometchat-flutter-v6/SKILL.md +1 -1
  141. package/skills/cometchat-flutter-v6-calls/SKILL.md +308 -243
  142. package/skills/cometchat-flutter-v6-calls/references/add-calls-to-existing-chat.md +134 -0
  143. package/skills/cometchat-flutter-v6-calls/references/call-layouts.md +102 -0
  144. package/skills/cometchat-flutter-v6-calls/references/call-session.md +229 -0
  145. package/skills/cometchat-flutter-v6-calls/references/device-management.md +99 -0
  146. package/skills/cometchat-flutter-v6-calls/references/group-calls.md +190 -0
  147. package/skills/cometchat-flutter-v6-calls/references/idle-timeout.md +80 -0
  148. package/skills/cometchat-flutter-v6-calls/references/in-call-chat.md +122 -0
  149. package/skills/cometchat-flutter-v6-calls/references/raise-hand.md +268 -0
  150. package/skills/cometchat-flutter-v6-calls/references/ringing-integration.md +171 -0
  151. package/skills/cometchat-flutter-v6-calls/references/server-push-bridge.md +93 -0
  152. package/skills/cometchat-flutter-v6-calls/references/share-invite.md +102 -0
  153. package/skills/cometchat-flutter-v6-components/SKILL.md +1 -1
  154. package/skills/cometchat-flutter-v6-conversations/SKILL.md +1 -1
  155. package/skills/cometchat-flutter-v6-core/SKILL.md +1 -1
  156. package/skills/cometchat-flutter-v6-customization/SKILL.md +1 -1
  157. package/skills/cometchat-flutter-v6-events/SKILL.md +1 -1
  158. package/skills/cometchat-flutter-v6-features/SKILL.md +1 -1
  159. package/skills/cometchat-flutter-v6-messages/SKILL.md +1 -1
  160. package/skills/cometchat-flutter-v6-migration/SKILL.md +1 -1
  161. package/skills/cometchat-flutter-v6-placement/SKILL.md +1 -1
  162. package/skills/cometchat-flutter-v6-production/SKILL.md +1 -1
  163. package/skills/cometchat-flutter-v6-push/SKILL.md +452 -0
  164. package/skills/cometchat-flutter-v6-testing/SKILL.md +319 -0
  165. package/skills/cometchat-flutter-v6-theming/SKILL.md +1 -1
  166. package/skills/cometchat-flutter-v6-troubleshooting/SKILL.md +1 -1
  167. package/skills/cometchat-flutter-v6-users-groups/SKILL.md +1 -1
  168. package/skills/cometchat-i18n/SKILL.md +358 -0
  169. package/skills/cometchat-ios/SKILL.md +5 -5
  170. package/skills/cometchat-ios-calls/SKILL.md +409 -0
  171. package/skills/cometchat-ios-calls/references/add-calls-to-existing-chat.md +172 -0
  172. package/skills/cometchat-ios-calls/references/avaudiosession-routing.md +189 -0
  173. package/skills/cometchat-ios-calls/references/call-layouts.md +136 -0
  174. package/skills/cometchat-ios-calls/references/call-session.md +221 -0
  175. package/skills/cometchat-ios-calls/references/callkit-and-pushkit.md +353 -0
  176. package/skills/cometchat-ios-calls/references/custom-ui.md +322 -0
  177. package/skills/cometchat-ios-calls/references/device-management.md +171 -0
  178. package/skills/cometchat-ios-calls/references/group-calls.md +396 -0
  179. package/skills/cometchat-ios-calls/references/idle-timeout.md +185 -0
  180. package/skills/cometchat-ios-calls/references/in-call-chat.md +183 -0
  181. package/skills/cometchat-ios-calls/references/migration-v4-to-v5.md +138 -0
  182. package/skills/cometchat-ios-calls/references/picture-in-picture.md +246 -0
  183. package/skills/cometchat-ios-calls/references/raise-hand.md +239 -0
  184. package/skills/cometchat-ios-calls/references/recording-screen-share.md +339 -0
  185. package/skills/cometchat-ios-calls/references/ringing-integration.md +142 -0
  186. package/skills/cometchat-ios-calls/references/server-apns-pushkit.md +267 -0
  187. package/skills/cometchat-ios-calls/references/share-invite.md +152 -0
  188. package/skills/cometchat-ios-calls/references/swiftui-uikit-hosting.md +246 -0
  189. package/skills/cometchat-ios-calls/references/voip-cert-setup.md +166 -0
  190. package/skills/cometchat-ios-components/SKILL.md +1 -1
  191. package/skills/cometchat-ios-core/SKILL.md +1 -1
  192. package/skills/cometchat-ios-customization/SKILL.md +1 -1
  193. package/skills/cometchat-ios-features/SKILL.md +1 -1
  194. package/skills/cometchat-ios-placement/SKILL.md +1 -1
  195. package/skills/cometchat-ios-production/SKILL.md +1 -1
  196. package/skills/cometchat-ios-push/SKILL.md +1 -1
  197. package/skills/cometchat-ios-testing/SKILL.md +371 -0
  198. package/skills/cometchat-ios-theming/SKILL.md +1 -1
  199. package/skills/cometchat-ios-troubleshooting/SKILL.md +1 -1
  200. package/skills/cometchat-native-bare-patterns/SKILL.md +45 -3
  201. package/skills/cometchat-native-calls/SKILL.md +599 -0
  202. package/skills/cometchat-native-calls/references/add-calls-to-existing-chat.md +203 -0
  203. package/skills/cometchat-native-calls/references/call-layouts.md +124 -0
  204. package/skills/cometchat-native-calls/references/call-session.md +182 -0
  205. package/skills/cometchat-native-calls/references/custom-ui.md +250 -0
  206. package/skills/cometchat-native-calls/references/device-management.md +135 -0
  207. package/skills/cometchat-native-calls/references/expo-vs-bare.md +179 -0
  208. package/skills/cometchat-native-calls/references/group-calls.md +291 -0
  209. package/skills/cometchat-native-calls/references/idle-timeout.md +128 -0
  210. package/skills/cometchat-native-calls/references/in-call-chat.md +143 -0
  211. package/skills/cometchat-native-calls/references/migration-v4-to-v5.md +72 -0
  212. package/skills/cometchat-native-calls/references/picture-in-picture.md +276 -0
  213. package/skills/cometchat-native-calls/references/raise-hand.md +203 -0
  214. package/skills/cometchat-native-calls/references/recording-screen-share.md +290 -0
  215. package/skills/cometchat-native-calls/references/ringing-integration.md +118 -0
  216. package/skills/cometchat-native-calls/references/server-push-bridge.md +135 -0
  217. package/skills/cometchat-native-calls/references/server-push-payloads.md +193 -0
  218. package/skills/cometchat-native-calls/references/share-invite.md +144 -0
  219. package/skills/cometchat-native-calls/references/voip-push-end-to-end.md +317 -0
  220. package/skills/cometchat-native-components/SKILL.md +1 -1
  221. package/skills/cometchat-native-core/SKILL.md +1 -1
  222. package/skills/cometchat-native-customization/SKILL.md +1 -1
  223. package/skills/cometchat-native-expo-patterns/SKILL.md +18 -1
  224. package/skills/cometchat-native-features/SKILL.md +1 -1
  225. package/skills/cometchat-native-placement/SKILL.md +1 -1
  226. package/skills/cometchat-native-production/SKILL.md +1 -1
  227. package/skills/cometchat-native-push/SKILL.md +1 -1
  228. package/skills/cometchat-native-testing/SKILL.md +1 -1
  229. package/skills/cometchat-native-theming/SKILL.md +1 -1
  230. package/skills/cometchat-native-troubleshooting/SKILL.md +1 -1
  231. package/skills/cometchat-nextjs-patterns/SKILL.md +1 -1
  232. package/skills/cometchat-placement/SKILL.md +1 -1
  233. package/skills/cometchat-production/SKILL.md +1 -1
  234. package/skills/cometchat-react-calls/SKILL.md +539 -0
  235. package/skills/cometchat-react-calls/references/add-calls-to-existing-chat.md +145 -0
  236. package/skills/cometchat-react-calls/references/call-layouts.md +161 -0
  237. package/skills/cometchat-react-calls/references/call-session.md +235 -0
  238. package/skills/cometchat-react-calls/references/custom-ui.md +201 -0
  239. package/skills/cometchat-react-calls/references/device-management.md +206 -0
  240. package/skills/cometchat-react-calls/references/group-calls.md +262 -0
  241. package/skills/cometchat-react-calls/references/idle-timeout.md +175 -0
  242. package/skills/cometchat-react-calls/references/in-call-chat.md +212 -0
  243. package/skills/cometchat-react-calls/references/migration-v4-to-v5.md +172 -0
  244. package/skills/cometchat-react-calls/references/picture-in-picture.md +245 -0
  245. package/skills/cometchat-react-calls/references/raise-hand.md +238 -0
  246. package/skills/cometchat-react-calls/references/recording-screen-share.md +143 -0
  247. package/skills/cometchat-react-calls/references/ringing-integration.md +255 -0
  248. package/skills/cometchat-react-calls/references/server-web-push-vapid.md +241 -0
  249. package/skills/cometchat-react-calls/references/share-invite.md +176 -0
  250. package/skills/cometchat-react-calls/references/testing-calls-on-web.md +198 -0
  251. package/skills/cometchat-react-calls/references/voip-and-web-push.md +165 -0
  252. package/skills/cometchat-react-patterns/SKILL.md +1 -1
  253. package/skills/cometchat-react-push/SKILL.md +448 -0
  254. package/skills/cometchat-react-router-patterns/SKILL.md +1 -1
  255. package/skills/cometchat-react-testing/SKILL.md +404 -0
  256. package/skills/cometchat-theming/SKILL.md +3 -3
  257. package/skills/cometchat-troubleshooting/SKILL.md +2 -2
@@ -0,0 +1,319 @@
1
+ ---
2
+ name: cometchat-flutter-v6-testing
3
+ description: Testing patterns for CometChat Flutter UIKit v6 (beta, Bloc-based). Covers flutter_test + bloc_test for Bloc unit tests, mocktail for SDK mocking, widget tests around the Bloc-driven CometChat widgets, integration_test for real-device flows, golden tests for theming, and CI on GitHub Actions / Codemagic. Sister skill of cometchat-flutter-v5-testing — the cohorts have different state-management primitives (GetX vs Bloc) so the patterns differ.
4
+ license: "MIT"
5
+ compatibility: "Flutter >= 2.5, Dart >= 3.0; flutter_test (built-in); bloc_test >= 9.0; mocktail >= 1.0; integration_test (built-in); cometchat_chat_uikit ^6.0.0-beta2"
6
+ allowed-tools: "shell, file-read, file-search, file-list, ask-user"
7
+ metadata:
8
+ author: "CometChat"
9
+ version: "4.0.0"
10
+ tags: "cometchat flutter v6 testing flutter-test bloc bloc-test mocktail widget-test integration-test golden-test ci codemagic"
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Test recipes for Flutter UIKit v6 (beta, Bloc-based). Most of the v5 patterns carry over; the deltas are around state-management primitives (Bloc, not GetX) and the unified `cometchat_chat_uikit` package (calls bundled — see `cometchat-flutter-v6-calls`).
16
+
17
+ **Read these other skills first:**
18
+ - `cometchat-flutter-v6-core` — UIKitSettings, init/login order, hard rules
19
+ - `cometchat-flutter-v6-events` — Bloc-based event streams
20
+ - `cometchat-flutter-v5-testing` — patterns that aren't v6-specific (CI config, golden tests, mocktail intro) — read first if you haven't
21
+
22
+ **Ground truth:**
23
+ - bloc_test — https://pub.dev/packages/bloc_test
24
+ - flutter_bloc — https://bloclibrary.dev/
25
+
26
+ ---
27
+
28
+ ## 1. The v5 → v6 testing delta
29
+
30
+ | Concern | v5 | v6 |
31
+ |---|---|---|
32
+ | State management | GetX | Bloc |
33
+ | DI in tests | `Get.reset()` between tests | Provide via `MultiBlocProvider` per test, or use `BlocProvider.value` with a mock |
34
+ | Calls package | `cometchat_calls_uikit` (separate) | bundled into `cometchat_chat_uikit` |
35
+ | Init order | `..callingExtension = CometChatCallingExtension()` on UIKitSettingsBuilder | `CometChatUIKitCalls.init` inside `CometChatUIKit.init` onSuccess |
36
+ | Listener IDs | Stable string for `addCallListener` | Bloc subscription, automatic cleanup |
37
+ | State persistence between tests | Get singletons leak — must reset | Bloc state is per-instance — no global reset, but providers must be re-created per test |
38
+
39
+ Most assertions stay the same; the wiring around them changes.
40
+
41
+ ---
42
+
43
+ ## 2. Mocktail + bloc_test setup
44
+
45
+ ```yaml
46
+ # pubspec.yaml
47
+ dev_dependencies:
48
+ flutter_test:
49
+ sdk: flutter
50
+ bloc_test: ^9.0.0
51
+ mocktail: ^1.0.0
52
+ integration_test:
53
+ sdk: flutter
54
+ ```
55
+
56
+ ### Service abstraction
57
+
58
+ Same shape as v5 (see `cometchat-flutter-v5-testing/SKILL.md` Section 2):
59
+
60
+ ```dart
61
+ // lib/services/cometchat_service.dart
62
+ abstract class CometChatService {
63
+ Future<void> init();
64
+ Future<User> login(String uid);
65
+ Future<void> logout();
66
+ User? getLoggedInUser();
67
+ Stream<TextMessage> messageStream();
68
+ }
69
+
70
+ class CometChatServiceImpl implements CometChatService {
71
+ @override
72
+ Future<void> init() async {
73
+ final settings = (UIKitSettings.builder()
74
+ ..appId = CometChatConfig.appId
75
+ ..region = CometChatConfig.region
76
+ ..authKey = CometChatConfig.authKey
77
+ ..subscriptionType = CometChatSubscriptionType.allUsers)
78
+ .build();
79
+
80
+ await Future<void>.value(); // Real impl: completer-wrap CometChatUIKit.init
81
+ // Then chain calls init in onSuccess (rule 1.1 from cometchat-flutter-v6-calls)
82
+ }
83
+
84
+ // ... rest
85
+ }
86
+ ```
87
+
88
+ ---
89
+
90
+ ## 3. Bloc unit tests with bloc_test
91
+
92
+ ```dart
93
+ // test/blocs/auth_bloc_test.dart
94
+ import 'package:bloc_test/bloc_test.dart';
95
+ import 'package:flutter_test/flutter_test.dart';
96
+ import 'package:mocktail/mocktail.dart';
97
+ import 'package:your_app/blocs/auth_bloc.dart';
98
+ import 'package:your_app/services/cometchat_service.dart';
99
+
100
+ class MockCometChatService extends Mock implements CometChatService {}
101
+ class FakeAuthEvent extends Fake implements AuthEvent {}
102
+
103
+ void main() {
104
+ late MockCometChatService mockService;
105
+
106
+ setUpAll(() {
107
+ registerFallbackValue(FakeAuthEvent());
108
+ });
109
+
110
+ setUp(() {
111
+ mockService = MockCometChatService();
112
+ });
113
+
114
+ blocTest<AuthBloc, AuthState>(
115
+ 'emits Authenticated when login succeeds',
116
+ setUp: () {
117
+ when(() => mockService.init()).thenAnswer((_) async {});
118
+ when(() => mockService.login(any())).thenAnswer(
119
+ (_) async => User(uid: 'cometchat-uid-1', name: 'Alice'),
120
+ );
121
+ },
122
+ build: () => AuthBloc(service: mockService),
123
+ act: (bloc) => bloc.add(LoginRequested(uid: 'cometchat-uid-1')),
124
+ expect: () => [
125
+ isA<AuthLoading>(),
126
+ isA<Authenticated>(),
127
+ ],
128
+ verify: (_) {
129
+ verify(() => mockService.init()).called(1);
130
+ verify(() => mockService.login('cometchat-uid-1')).called(1);
131
+ },
132
+ );
133
+
134
+ blocTest<AuthBloc, AuthState>(
135
+ 'emits AuthError when login fails',
136
+ setUp: () {
137
+ when(() => mockService.init()).thenAnswer((_) async {});
138
+ when(() => mockService.login(any())).thenThrow(Exception('401 Unauthorized'));
139
+ },
140
+ build: () => AuthBloc(service: mockService),
141
+ act: (bloc) => bloc.add(LoginRequested(uid: 'cometchat-uid-1')),
142
+ expect: () => [
143
+ isA<AuthLoading>(),
144
+ predicate<AuthState>((s) => s is AuthError && s.message.contains('Unauthorized')),
145
+ ],
146
+ );
147
+ }
148
+ ```
149
+
150
+ `bloc_test` handles the boilerplate of subscribing to the bloc, dispatching events, and asserting state sequence.
151
+
152
+ ---
153
+
154
+ ## 4. Widget tests with BlocProvider
155
+
156
+ ```dart
157
+ import 'package:flutter/material.dart';
158
+ import 'package:flutter_test/flutter_test.dart';
159
+ import 'package:flutter_bloc/flutter_bloc.dart';
160
+ import 'package:mocktail/mocktail.dart';
161
+ import 'package:your_app/screens/chat_screen.dart';
162
+ import 'package:your_app/blocs/auth_bloc.dart';
163
+
164
+ class MockAuthBloc extends MockBloc<AuthEvent, AuthState> implements AuthBloc {}
165
+ class FakeAuthState extends Fake implements AuthState {}
166
+ class FakeAuthEvent extends Fake implements AuthEvent {}
167
+
168
+ void main() {
169
+ setUpAll(() {
170
+ registerFallbackValue(FakeAuthState());
171
+ registerFallbackValue(FakeAuthEvent());
172
+ });
173
+
174
+ testWidgets('shows loading on AuthLoading state', (tester) async {
175
+ final mockBloc = MockAuthBloc();
176
+ when(() => mockBloc.state).thenReturn(AuthLoading());
177
+
178
+ await tester.pumpWidget(
179
+ MaterialApp(
180
+ home: BlocProvider<AuthBloc>.value(
181
+ value: mockBloc,
182
+ child: ChatScreen(),
183
+ ),
184
+ ),
185
+ );
186
+
187
+ expect(find.byType(CircularProgressIndicator), findsOneWidget);
188
+ });
189
+
190
+ testWidgets('shows error on AuthError state', (tester) async {
191
+ final mockBloc = MockAuthBloc();
192
+ when(() => mockBloc.state).thenReturn(AuthError(message: '401 Unauthorized'));
193
+
194
+ await tester.pumpWidget(
195
+ MaterialApp(
196
+ home: BlocProvider<AuthBloc>.value(value: mockBloc, child: ChatScreen()),
197
+ ),
198
+ );
199
+
200
+ expect(find.textContaining('Unauthorized'), findsOneWidget);
201
+ });
202
+ }
203
+ ```
204
+
205
+ `BlocProvider.value` is for tests; `BlocProvider(create: ...)` is for production.
206
+
207
+ ---
208
+
209
+ ## 5. Mocking the kit's call widgets
210
+
211
+ V6 calls widgets fire BLoC events internally. Mocking is the same pattern — wrap your custom call surfaces in service abstractions, mock at that layer.
212
+
213
+ For widgets like `<CometChatOngoingCall>` that you don't control, the strategy is the same as v5: replace at composition boundary or skip widget tests for them and rely on integration tests.
214
+
215
+ ---
216
+
217
+ ## 6. Integration tests (same as v5)
218
+
219
+ ```dart
220
+ // integration_test/chat_test.dart
221
+ import 'package:flutter/material.dart';
222
+ import 'package:flutter_test/flutter_test.dart';
223
+ import 'package:integration_test/integration_test.dart';
224
+ import 'package:your_app/main.dart' as app;
225
+
226
+ void main() {
227
+ IntegrationTestWidgetsFlutterBinding.ensureInitialized();
228
+
229
+ testWidgets('login and see conversations', (tester) async {
230
+ app.main();
231
+ await tester.pumpAndSettle(Duration(seconds: 10));
232
+
233
+ expect(find.text('Welcome'), findsOneWidget);
234
+
235
+ await tester.tap(find.text('Messages'));
236
+ await tester.pumpAndSettle();
237
+
238
+ expect(find.byType(ListTile), findsAtLeastNWidgets(1));
239
+ });
240
+ }
241
+ ```
242
+
243
+ Same shape as v5; the underlying SDK is different but the integration test contract is the same.
244
+
245
+ ---
246
+
247
+ ## 7. Golden tests (same as v5)
248
+
249
+ See `cometchat-flutter-v5-testing/SKILL.md` Section 6 — the patterns are identical. The kit's V6 themes use Material 3 by default; pin Flutter version to ensure golden stability.
250
+
251
+ ---
252
+
253
+ ## 8. Calls testing in v6
254
+
255
+ V6 bundles calls into `cometchat_chat_uikit`. Tests that touch calls:
256
+
257
+ ```dart
258
+ blocTest<CallBloc, CallState>(
259
+ 'emits CallActive when initiateCall succeeds',
260
+ setUp: () {
261
+ when(() => mockService.initiateCall(any())).thenAnswer(
262
+ (_) async => Call(sessionId: 'session-123'),
263
+ );
264
+ },
265
+ build: () => CallBloc(service: mockService),
266
+ act: (bloc) => bloc.add(InitiateCall(receiverUid: 'cometchat-uid-2')),
267
+ expect: () => [isA<CallInitiating>(), isA<CallActive>()],
268
+ );
269
+ ```
270
+
271
+ **The init order rule applies in tests too:** mock `init` to resolve before any `initiateCall`-related test runs. The simplest way is to wire init in your test's `setUpAll`:
272
+
273
+ ```dart
274
+ setUpAll(() async {
275
+ registerFallbackValue(FakeCallEvent());
276
+ // If your AuthBloc init is shared, run it once here:
277
+ // await mockAuthBloc.add(AppStarted());
278
+ });
279
+ ```
280
+
281
+ For widget tests of call screens, see `cometchat-flutter-v6-calls` Section 7's verification checklist — the same checks belong in the test file:
282
+
283
+ - Was init called before the call screen mounted?
284
+ - Does the call screen show the WebRTC view after the session starts?
285
+ - Does hangup call `endSession` AND `Navigator.pop`?
286
+
287
+ ---
288
+
289
+ ## 9. Anti-patterns
290
+
291
+ 1. **Reusing a single `MockBloc` across tests** without resetting. State leaks. Either re-create per test or use `tearDown(() => mockBloc.close())`.
292
+ 2. **Skipping `registerFallbackValue` for events / states.** mocktail crashes the test runner without it; the error message is unclear.
293
+ 3. **`Bloc` subclasses with side effects in their constructor.** Tests mount the bloc and side effects fire (e.g. real SDK init). Move side effects to event handlers, dispatch them explicitly in tests.
294
+ 4. **`emit` checks that depend on equality.** Bloc states often have `Equatable` mixed in; if not, `expect: () => [SomeState()]` fails because two `SomeState()` instances aren't equal. Use `predicate<T>(...)` or verify via `isA<SomeState>()` + later assertions.
295
+ 5. **Real `flutter_bloc` ChangeNotifierProvider in widget tests.** Mock the bloc directly via `BlocProvider.value(value: mockBloc)`.
296
+ 6. **Skipping pump after state emit.** `bloc_test` handles state assertions, but widget tests need explicit `await tester.pump()` after the bloc emits or the rebuild won't happen.
297
+
298
+ ## 10. Verification checklist
299
+
300
+ - [ ] `CometChatService` abstraction wrapping the SDK
301
+ - [ ] `MockCometChatService` and `MockAuthBloc` (`MockBloc<E, S>`) in test files
302
+ - [ ] `registerFallbackValue` calls in `setUpAll` for events + states
303
+ - [ ] At least one bloc_test for "AuthBloc emits Authenticated on successful login"
304
+ - [ ] At least one bloc_test for "AuthBloc emits AuthError on login failure"
305
+ - [ ] At least one widget test for "shows loading until login resolves"
306
+ - [ ] At least one widget test for "error UI on auth failure"
307
+ - [ ] Integration test for login + see conversations
308
+ - [ ] Calls integration test asserting init order rule (chat init → calls init → calls available)
309
+ - [ ] CI uses dedicated CometChat test app via `--dart-define`
310
+ - [ ] Flutter version pinned in CI
311
+
312
+ ## 11. Pointers
313
+
314
+ - `cometchat-flutter-v6-core` — init/login order, hard rules
315
+ - `cometchat-flutter-v6-events` — Bloc event streams
316
+ - `cometchat-flutter-v6-calls` — calls integration; hard rules to assert in tests
317
+ - `cometchat-flutter-v6-troubleshooting` — when tests pass but production breaks
318
+ - `cometchat-flutter-v5-testing` — for shared patterns (CI, goldens, mocktail intro)
319
+ - `cometchat-flutter-v6-migration` — v5 → v6 migration recipes (test rewrites)
@@ -10,7 +10,7 @@ description: >
10
10
  user asks about changing colors, fonts, spacing, or appearance of chat components.
11
11
  license: "MIT"
12
12
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter >=2.5.0"
13
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
13
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
14
14
  metadata:
15
15
  author: "CometChat"
16
16
  version: "3.0.0"
@@ -7,7 +7,7 @@ description: >
7
7
  errors, crashes, or unexpected behavior with CometChat components.
8
8
  license: "MIT"
9
9
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2"
10
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
10
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
11
11
  metadata:
12
12
  author: "CometChat"
13
13
  version: "3.0.0"
@@ -9,7 +9,7 @@ description: >
9
9
  GroupMembersRequestBuilder, or customizing user/group list items.
10
10
  license: "MIT"
11
11
  compatibility: "cometchat_chat_uikit ^6.0.0-beta2; flutter_bloc ^8.1.0"
12
- allowed-tools: "executeBash, readFile, readCode, fileSearch, listDirectory, grepSearch"
12
+ allowed-tools: "shell, file-read, file-search, file-list, grep"
13
13
  metadata:
14
14
  author: "CometChat"
15
15
  version: "3.0.0"