Fakultas Ilmu Komputer UI

Commit e87bb5ef authored by Usman Sidiq's avatar Usman Sidiq
Browse files

[RED] Add navigation test to Login

parent cdb62534
Pipeline #41972 failed with stages
in 26 minutes and 57 seconds
......@@ -3,6 +3,7 @@ import 'package:mockito/mockito.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ppl_disabilitas/network/network_interface.dart';
import 'package:ppl_disabilitas/page/dashboard/dashboard.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:http/http.dart' as http;
import 'package:pedantic/pedantic.dart';
......@@ -83,5 +84,24 @@ void main() {
await tester.pumpAndSettle();
expect(popResult, 'Take me back');
});
Future<Null> _navigateToLoginPage(WidgetTester tester) async {
final drawer = find.byType(BisaGoDrawer);
await tester.tap(drawer);
final textToFind = 'Login';
await tester.tap(find.text(textToFind));
await tester.pump();
}
testWidgets(
'when tapping text form field, should navigate to pencarian page',
(WidgetTester tester) async {
final textFieldLogin = 'Masuk ke Akun';
await _buildDashboardPage(tester);
await _navigateToLoginPage(tester);
verify(mockObserver.didPush(any, any));
expect(find.text(textFieldLogin), findsOneWidget);
});
});
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment