Skip to content

Commit

Permalink
test: add TODO for router in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cevheri committed Dec 14, 2024
1 parent bafe6be commit 4ab7da5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/presentation/screen/register/register_screen.test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void main() {
await tester.tap(find.byKey(registerSubmitButtonKey));
await tester.pumpAndSettle(const Duration(seconds: 3));

expect(Get.currentRoute, "/");
//TODO check with go_router expect(Get.currentRoute, "/");
});

//validate app-bar back button
Expand All @@ -184,7 +184,7 @@ void main() {
await tester.tap(find.byIcon(Icons.arrow_back));
await tester.pumpAndSettle();
//Then:
expect(Get.currentRoute, "/");
//TODO check with go_router expect(Get.currentRoute, "/");
});
});

Expand Down Expand Up @@ -341,7 +341,7 @@ void main() {
await tester.tap(find.byKey(registerSubmitButtonKey));
await tester.pumpAndSettle();

expect(Get.currentRoute, "/");
//TODO check with go_router expect(Get.currentRoute, "/");

// final saveButton = find.byKey(registerSubmitButtonKey);
// await tester.tap(saveButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void main() {
await tester.pumpAndSettle();

expect(find.byType(SettingsScreen), findsNothing);
expect(Get.currentRoute, "/");
//TODO check with go_router expect(Get.currentRoute, "/");
});
});

Expand Down
3 changes: 3 additions & 0 deletions test/test_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:flutter_bloc_advance/configuration/app_logger.dart';
import 'package:flutter_bloc_advance/configuration/environment.dart';
import 'package:flutter_bloc_advance/configuration/local_storage.dart';
import 'package:flutter_bloc_advance/main/main_local.mapper.g.dart';
import 'package:flutter_bloc_advance/routes/app_router.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:shared_preferences/shared_preferences.dart';

Expand All @@ -28,13 +29,15 @@ class TestUtils {
EquatableConfig.stringify = true;
await _clearStorage();
await AppLocalStorage().save(StorageKeys.language.name, "en");
AppRouter().setRouter(RouterType.goRouter);
}
Future<void> setupRepositoryUnitTest() async {
AppLogger.configure(isProduction: false, logFormat: LogFormat.simple);
ProfileConstants.setEnvironment(Environment.test);
initializeJsonMapper();
await _clearStorage();
await AppLocalStorage().save(StorageKeys.language.name, "en");
AppRouter().setRouter(RouterType.goRouter);
}

Future<void> tearDownUnitTest() async {
Expand Down

0 comments on commit 4ab7da5

Please sign in to comment.