feat(video_calls, welcome_screen): ios mic fix, welcome scrin layoute fix

This commit is contained in:
misha
2026-09-28 11:20:52 +03:00
parent ae4f9d2e9b
commit 2dce28b196
17 changed files with 3303 additions and 1537 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,9 @@ import 'chat_screen_loaded_smoke_test.mocks.dart';
void main() {
group('ChatScreen loaded smoke', () {
setUpAll(() async {
dotenv.loadFromString(envString: 'DEV_BASE_URL=http://localhost\nBASE_URL=http://localhost');
dotenv.loadFromString(
envString: 'DEV_BASE_URL=http://localhost\nBASE_URL=http://localhost',
);
await initializeDateFormatting('ru', null);
await initializeDateFormatting('ru_RU', null);
await initializeDateFormatting('RU', null);
@@ -37,7 +39,11 @@ void main() {
setUp(() async {
await sl.reset();
sl.registerLazySingleton<AppConfig>(() => AppConfig(buildType: AppBuildType.tests)..setBaseUrl('http://localhost'));
sl.registerLazySingleton<AppConfig>(
() =>
AppConfig(buildType: AppBuildType.tests)
..setBaseUrl('http://localhost'),
);
sl.registerLazySingleton<WsManager>(() => _FakeWsManager());
});
@@ -47,7 +53,9 @@ void main() {
</svg>
''';
final fakeBundle = _FakeAssetBundle({'assets/icons/error_icon.svg': fakeSvg});
final fakeBundle = _FakeAssetBundle({
'assets/icons/error_icon.svg': fakeSvg,
});
Widget wrap(Widget child, ChatsCubit chatsCubit) {
return DefaultAssetBundle(
@@ -70,8 +78,18 @@ void main() {
id: '1',
chatRoomSettings: ChatRoomSettingsModel(name: 'room', state: 'active'),
users: Users(
sender: ChatUserModel(id: 1, name: 'Me', slug: 'me', profilePhotoUrl: null),
receiver: ChatUserModel(id: 2, name: 'User Two', slug: 'user-two', profilePhotoUrl: null),
sender: ChatUserModel(
id: 1,
name: 'Me',
slug: 'me',
profilePhotoUrl: null,
),
receiver: ChatUserModel(
id: 2,
name: 'User Two',
slug: 'user-two',
profilePhotoUrl: null,
),
),
chosenPlanId: null,
chosenPlan: null,
@@ -147,12 +165,19 @@ void main() {
);
when(chatRoomCubit.state).thenReturn(state);
when(chatRoomCubit.stream).thenAnswer((_) => const Stream<ChatRoomState>.empty());
when(
chatRoomCubit.stream,
).thenAnswer((_) => const Stream<ChatRoomState>.empty());
when(chatRoomCubit.close()).thenAnswer((_) async => Future<void>.value());
when(chatRoomCubit.initChat(any, sendInitialMessage: anyNamed('sendInitialMessage'), orderId: anyNamed('orderId')))
.thenAnswer((_) async => 'uuid');
when(
chatRoomCubit.initChat(
any,
sendInitialMessage: anyNamed('sendInitialMessage'),
orderId: anyNamed('orderId'),
),
).thenAnswer((_) async => 'uuid');
when(chatRoomCubit.setTimer()).thenReturn(null);
when(chatRoomCubit.refreshChat()).thenAnswer((_) async {});
sl.registerFactory<ChatRoomCubit>(() => chatRoomCubit);
@@ -160,11 +185,17 @@ void main() {
when(chatsCubit.stream).thenAnswer((_) => const Stream.empty());
when(chatsCubit.close()).thenAnswer((_) async => Future<void>.value());
await tester.pumpWidget(wrap(const ChatScreen(uuid: 'uuid', sendInitialMessage: false), chatsCubit));
await tester.pumpWidget(
wrap(
const ChatScreen(uuid: 'uuid', sendInitialMessage: false),
chatsCubit,
),
);
await tester.pump();
await tester.pump(const Duration(milliseconds: 200));
expect(find.byType(ChatScreen), findsOneWidget);
expect(find.byType(RefreshIndicator), findsOneWidget);
expect(find.text('User Two'), findsOneWidget);
expect(find.text('hello'), findsOneWidget);
expect(find.text('hi'), findsOneWidget);