Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
DTB-Layanan Fasilitas Publik Penyandang Disabilitas
PoiPoLeGan-PPLapanganTembak-DTB Layanan Fasilitas Publik Penyandang Disabilitas-FE
Commits
e87bb5ef
Commit
e87bb5ef
authored
Apr 20, 2020
by
Usman Sidiq
Browse files
[RED] Add navigation test to Login
parent
cdb62534
Pipeline
#41972
failed with stages
in 26 minutes and 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
test/mock_test.dart
View file @
e87bb5ef
...
...
@@ -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
);
});
});
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment