@@ -285,6 +285,96 @@ void main() {
285
285
},
286
286
);
287
287
288
+ // testWidgets(
289
+ // 'Test that start the audio input is correctly appears',
290
+ // (WidgetTester tester) async {
291
+ //
292
+ // final client = MockClient();
293
+ // final clientState = MockClientState();
294
+ // final channel = MockChannel();
295
+ // final channelState = MockChannelState();
296
+ // final lastMessageAt = DateTime.parse('2020-06-22 12:00:00');
297
+ // final mockRecordController = MockStreamRecordController();
298
+ //
299
+ // when(() => client.state).thenReturn(clientState);
300
+ // when(() => clientState.currentUser).thenReturn(OwnUser(id: 'user-id'));
301
+ // when(() => channel.lastMessageAt).thenReturn(lastMessageAt);
302
+ // when(() => channel.state).thenReturn(channelState);
303
+ // when(() => channel.client).thenReturn(client);
304
+ // when(() => channel.isMuted).thenReturn(false);
305
+ // when(() => channel.isMutedStream).thenAnswer((i) => Stream.value(false));
306
+ // when(() => channel.extraDataStream).thenAnswer(
307
+ // (i) => Stream.value({
308
+ // 'name': 'test',
309
+ // }),
310
+ // );
311
+ // when(() => channel.extraData).thenReturn({
312
+ // 'name': 'test',
313
+ // });
314
+ // when(() => channelState.membersStream).thenAnswer(
315
+ // (i) => Stream.value([
316
+ // Member(
317
+ // userId: 'user-id',
318
+ // user: User(id: 'user-id'),
319
+ // )
320
+ // ]),
321
+ // );
322
+ // when(() => channelState.members).thenReturn([
323
+ // Member(
324
+ // userId: 'user-id',
325
+ // user: User(id: 'user-id'),
326
+ // ),
327
+ // ]);
328
+ // when(() => channelState.messages).thenReturn([
329
+ // Message(
330
+ // text: 'hello',
331
+ // user: User(id: 'other-user'),
332
+ // )
333
+ // ]);
334
+ // when(() => channelState.messagesStream).thenAnswer(
335
+ // (i) => Stream.value([
336
+ // Message(
337
+ // text: 'hello',
338
+ // user: User(id: 'other-user'),
339
+ // )
340
+ // ]),
341
+ // );
342
+ //
343
+ // final recordStateController = BehaviorSubject<RecordState>();
344
+ // when(() => mockRecordController.recordState)
345
+ // .thenAnswer((_) => recordStateController.stream);
346
+ //
347
+ // await tester.pumpWidget(MaterialApp(
348
+ // home: StreamChat(
349
+ // client: client,
350
+ // child: StreamChannel(
351
+ // channel: channel,
352
+ // child: Scaffold(
353
+ // body: StreamMessageInput(
354
+ // enableAudioRecord: false,
355
+ // // recordController: mockRecordController,
356
+ // ),
357
+ // ),
358
+ // ),
359
+ // ),
360
+ // ));
361
+ //
362
+ // await tester.runAsync(() async {
363
+ // recordStateController.add(RecordState.record);
364
+ //
365
+ // await Future<void>.delayed(const Duration(milliseconds: 100));
366
+ //
367
+ // // expect(find.byKey(const Key('startRecord')), findsNothing);
368
+ // // expect(
369
+ // // find.byWidgetPredicate((widget) => widget is RecordField),
370
+ // // findsOneWidget,
371
+ // // );
372
+ // recordStateController.close();
373
+ // }
374
+ // );
375
+ // },
376
+ // );
377
+
288
378
testWidgets (
289
379
'checks message input slow mode' ,
290
380
(WidgetTester tester) async {
0 commit comments