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

View File

@@ -1,3 +1,4 @@
import 'package:eatvio_app/app_keys.dart';
import 'package:eatvio_app/core/app_config.dart';
import 'package:eatvio_app/core/app_initializer.dart';
import 'package:eatvio_app/core/locator_service.dart';
@@ -18,28 +19,48 @@ import 'welcome_screen_test.mocks.dart';
void main() {
group('WelcomeScreen 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',
);
});
setUp(() async {
SharedPreferences.setMockInitialValues({});
await sl.reset();
sl.registerLazySingleton<AppConfig>(() => AppConfig(buildType: AppBuildType.tests)..setBaseUrl('http://localhost'));
sl.registerLazySingleton<AppConfig>(
() =>
AppConfig(buildType: AppBuildType.tests)
..setBaseUrl('http://localhost'),
);
});
tearDown(() async {
await sl.reset();
});
Widget wrap(Widget child) {
Widget wrap(Widget child, {double textScale = 1}) {
return MaterialApp.router(
theme: ThemeHelper().themeData(),
builder: (context, appChild) {
return MediaQuery(
data: MediaQuery.of(
context,
).copyWith(textScaler: TextScaler.linear(textScale)),
child: appChild ?? const SizedBox.shrink(),
);
},
routerConfig: GoRouter(
initialLocation: '/',
routes: [
GoRoute(path: '/', builder: (context, state) => child),
GoRoute(path: '/feed-screen', builder: (context, state) => const SizedBox.shrink()),
GoRoute(path: '/auth-screen', builder: (context, state) => const SizedBox.shrink()),
GoRoute(
path: '/feed-screen',
builder: (context, state) => const SizedBox.shrink(),
),
GoRoute(
path: '/auth-screen',
builder: (context, state) => const SizedBox.shrink(),
),
],
),
);
@@ -48,7 +69,9 @@ void main() {
testWidgets('renders welcome screen', (tester) async {
final prefs = MockPrefs();
when(prefs.getBool(any)).thenReturn(false);
when(prefs.setBool(any, any)).thenAnswer((_) async => Future<void>.value());
when(
prefs.setBool(any, any),
).thenAnswer((_) async => Future<void>.value());
sl.registerLazySingleton<Prefs>(() => prefs);
@@ -59,5 +82,35 @@ void main() {
expect(find.text('Добро пожаловать!'), findsOneWidget);
expect(find.text('Начать пользоваться'), findsOneWidget);
});
testWidgets('start button stays tappable when system text is enlarged', (
tester,
) async {
final prefs = MockPrefs();
when(prefs.getBool(any)).thenReturn(false);
when(
prefs.setBool(any, any),
).thenAnswer((_) async => Future<void>.value());
sl.registerLazySingleton<Prefs>(() => prefs);
tester.view.physicalSize = const Size(390, 700);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
await tester.pumpWidget(wrap(const WelcomeScreen(), textScale: 2.4));
await tester.pump();
final button = find.byKey(AppKeys.welcomeScreenButton);
await tester.ensureVisible(button);
await tester.pump();
expect(tester.takeException(), isNull);
await tester.tap(button);
await tester.pumpAndSettle();
expect(find.text('Начать пользоваться'), findsNothing);
verify(prefs.setBool(any, true)).called(1);
});
});
}