forked from eatvio/eatvio_app
feat(feed): fixed comments state updating in feed, feat(consultantRegistration): fixed registration flow for users with unverified phone, feat(tests): fixed tests coverage
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:eatvio_app/core/app_initializer.dart';
|
||||
import 'package:eatvio_app/core/locator_service.dart';
|
||||
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
||||
import 'package:eatvio_app/features/dev_tools/presentation/dev_tools_screen.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -16,6 +17,7 @@ void main() {
|
||||
setUp(() async {
|
||||
await sl.reset();
|
||||
sl.registerLazySingleton<AppConfig>(() => AppConfig(buildType: AppBuildType.tests)..setBaseUrl('http://localhost'));
|
||||
sl.registerLazySingleton<Dio>(() => Dio(BaseOptions(baseUrl: 'http://localhost')));
|
||||
});
|
||||
|
||||
Widget wrap(Widget child) {
|
||||
@@ -39,5 +41,29 @@ void main() {
|
||||
|
||||
expect(find.byType(DevToolsScreenContent), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('updates base url from input by done button', (tester) async {
|
||||
await tester.pumpWidget(wrap(const DevToolsScreen()));
|
||||
await tester.pump();
|
||||
|
||||
await tester.enterText(find.byType(TextFormField).first, 'HTTP://EXAMPLE.COM');
|
||||
await tester.tap(find.byIcon(Icons.done));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(DevToolsScreenContent), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('toggle base url button is tappable', (tester) async {
|
||||
await tester.pumpWidget(wrap(const DevToolsScreen()));
|
||||
await tester.pump();
|
||||
|
||||
final toggleButton = find.text('Set production base url');
|
||||
expect(toggleButton, findsOneWidget);
|
||||
|
||||
await tester.tap(toggleButton);
|
||||
await tester.pump();
|
||||
|
||||
expect(find.byType(DevToolsScreenContent), findsOneWidget);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user