Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,20 @@ import 'package:alchemist/alchemist.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:record/record.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';

import '../fakes.dart';
import '../material_app_wrapper.dart';
import '../mocks.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

final originalRecordPlatform = RecordPlatform.instance;
setUp(() => RecordPlatform.instance = FakeRecordPlatform());
tearDown(() => RecordPlatform.instance = originalRecordPlatform);

group('EditMessageSheet tests', () {
testWidgets('appears on tap', (tester) async {
final channel = MockChannel();
Expand Down
40 changes: 40 additions & 0 deletions packages/stream_chat_flutter/test/src/fakes.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:path_provider_platform_interface/path_provider_platform_interface.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:record_platform_interface/record_platform_interface.dart';

const String kTemporaryPath = 'temporaryPath';
const String kApplicationSupportPath = 'applicationSupportPath';
Expand Down Expand Up @@ -101,3 +102,42 @@ class AllNullFakePathProviderPlatform extends Fake
return null;
}
}

class FakeRecordPlatform extends Fake
with MockPlatformInterfaceMixin
implements RecordPlatform {
@override
Future<void> create(String recorderId) async {}

@override
Future<bool> hasPermission(String recorderId) async {
return true;
}

@override
Future<bool> isPaused(String recorderId) async {
return false;
}

@override
Future<bool> isRecording(String recorderId) async {
return false;
}

@override
Future<void> pause(String recorderId) async {}

@override
Future<void> resume(String recorderId) async {}

@override
Future<String?> stop(String recorderId) async {
return 'path';
}

@override
Future<void> cancel(String recorderId) async {}

@override
Future<void> dispose(String recorderId) async {}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:record/record.dart';
import 'package:stream_chat_flutter/src/message_actions_modal/message_actions_modal.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';

import '../fakes.dart';
import '../mocks.dart';

void main() {
TestWidgetsFlutterBinding.ensureInitialized();

setUpAll(() {
registerFallbackValue(
MaterialPageRoute(builder: (context) => const SizedBox()));
MaterialPageRoute(builder: (context) => const SizedBox()),
);

registerFallbackValue(Message());
});

final originalRecordPlatform = RecordPlatform.instance;
setUp(() => RecordPlatform.instance = FakeRecordPlatform());
tearDown(() => RecordPlatform.instance = originalRecordPlatform);

testWidgets(
'it should show the all actions',
(WidgetTester tester) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:record/record.dart';
import 'package:stream_chat_flutter/src/message_input/dm_checkbox_list_tile.dart';
import 'package:stream_chat_flutter/stream_chat_flutter.dart';

import '../fakes.dart';
import '../mocks.dart';

void main() {
final originalRecordPlatform = RecordPlatform.instance;
setUp(() => RecordPlatform.instance = FakeRecordPlatform());
tearDown(() => RecordPlatform.instance = originalRecordPlatform);

testWidgets(
'checks message input features',
(WidgetTester tester) async {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter/widgets.dart' hide Key;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:stream_chat/stream_chat.dart' show StreamChatError;

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions sample_app/lib/firebase_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ class DefaultFirebaseOptions {
projectId: 'stream-chat-internal',
databaseURL: 'https://stream-chat-internal.firebaseio.com',
storageBucket: 'stream-chat-internal.appspot.com',
androidClientId: '674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com',
iosClientId: '674907137625-flarfn9cefu4lermgpbc4b8rm8l15ian.apps.googleusercontent.com',
androidClientId:
'674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com',
iosClientId:
'674907137625-flarfn9cefu4lermgpbc4b8rm8l15ian.apps.googleusercontent.com',
iosBundleId: 'io.getstream.flutter',
);

Expand All @@ -82,9 +84,10 @@ class DefaultFirebaseOptions {
projectId: 'stream-chat-internal',
databaseURL: 'https://stream-chat-internal.firebaseio.com',
storageBucket: 'stream-chat-internal.appspot.com',
androidClientId: '674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com',
iosClientId: '674907137625-p3msks3snq0h22l7ekpqcf0frr0vt8mg.apps.googleusercontent.com',
androidClientId:
'674907137625-0aa50j6b2i35ef9c52lsbk1v16otl492.apps.googleusercontent.com',
iosClientId:
'674907137625-p3msks3snq0h22l7ekpqcf0frr0vt8mg.apps.googleusercontent.com',
iosBundleId: 'io.getstream.streamChatV1',
);

}
}