Fakultas Ilmu Komputer UI

Commit 81a1e9fe authored by Ferdi Salim Sungkar's avatar Ferdi Salim Sungkar
Browse files

[GREEN] pulling from staging

parents 6d8516e8 e72f1abd
Pipeline #78843 passed with stages
in 8 minutes and 20 seconds
......@@ -668,7 +668,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-23T11:57:26.997448Z",
"generated": "2021-05-25T11:35:11.928633Z",
"generator": "pub",
"generatorVersion": "2.12.0"
}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":[]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_for_web-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-25 18:15:50.653912","version":"2.0.1"}
\ No newline at end of file
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":[]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility-5.0.0/","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_plugin_android_lifecycle-2.0.1/","dependencies":[]},{"name":"flutter_secure_storage","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_secure_storage-3.3.5/","dependencies":[]},{"name":"image_picker","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.7.4/","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-2.0.1/","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_macos-2.0.0/","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_linux-2.0.0/","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider_windows-2.0.0/","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_keyboard_visibility_web-2.0.0/","dependencies":[]},{"name":"image_picker_for_web","path":"/Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker_for_web-2.0.0/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_keyboard_visibility","dependencies":["flutter_keyboard_visibility_web"]},{"name":"flutter_keyboard_visibility_web","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","dependencies":[]},{"name":"flutter_secure_storage","dependencies":[]},{"name":"image_picker","dependencies":["flutter_plugin_android_lifecycle","image_picker_for_web"]},{"name":"image_picker_for_web","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]}],"date_created":"2021-05-25 18:38:53.444174","version":"2.0.1"}
\ No newline at end of file
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-23 18:57:26.922118.
# Generated by pub on 2021-05-25 18:35:11.904673.
_fe_analyzer_shared:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///Users/ferdisungkar/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
......@@ -122,7 +122,7 @@ class Api {
}
}
Future<String> gender(String gen) async {
Future gender(String gen) async {
var apiURL =
Uri.parse('https://canary.fundex.id/api/v1.1/member-attribute');
var token = await secureStorage.readSecureData('accessToken');
......@@ -140,15 +140,14 @@ class Api {
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var idMemberAttributeGender = jsonData['id'];
await secureStorage.writeSecureData(
'idMemberAttributeGender', idMemberAttributeGender);
'idMemberAttributeGender', idMemberAttributeGender.toString());
print(await secureStorage.readSecureData('idMemberAttributeGender'));
return 'Simpan Berhasil!';
} else {
print('gender ' + apiResult.statusCode.toString());
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
throw Exception('Gagal menyimpan gender');
}
}
......@@ -210,7 +209,7 @@ class Api {
print(apiResult.reasonPhrase);
print(apiResult.request);
print(apiResult.body);
throw Exception('Gagal menyimpan..');
throw Exception('Gagal menyimpan tempat lahir');
}
}
......@@ -362,4 +361,77 @@ class Api {
statusCode = apiResult.statusCode;
return (statusCode);
}
Future getMemberDocsId() async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-attributes?attribute_name=agreement_doc_id&offset=&limit=&order_by=');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
'Authorization': 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var memberAttributes =
(jsonData as Map<String, dynamic>)['member_attributes'];
var idMemberDocs = (memberAttributes as Map<String, dynamic>)['id'];
await secureStorage.writeSecureData('idMemberDocs', idMemberDocs);
print(await secureStorage.readSecureData('idMemberDocs'));
} else {
throw Exception('Failed to get MemberDocsID');
}
}
Future getMemberDocs(String memberDocsId) async {
final apiURL = Uri.parse(
'https://canary.fundex.id/api/v1.1/member-documents/$memberDocsId/private');
var token = await secureStorage.readSecureData('accessToken');
var headers = {
'Content-type': 'application/json',
'Authorization': 'Bearer $token',
};
var apiResult = await client.get(apiURL, headers: headers);
if (apiResult.statusCode == 200) {
var jsonObject = json.decode(apiResult.body);
var jsonData = (jsonObject as Map<String, dynamic>)['data'];
var memberDocument =
(jsonData as Map<String, dynamic>)['member_document'];
var description = (memberDocument as Map<String, dynamic>)['description'];
var download = (description as Map<String, dynamic>)['download'];
var expiredAt = (download as Map<String, dynamic>)['expiredAt'];
var name = (memberDocument as Map<String, dynamic>)['name'];
var imgUrl = (memberDocument as Map<String, dynamic>)['url'];
await secureStorage.writeSecureData('memberDocs-expiredAt', expiredAt);
await secureStorage.writeSecureData('memberDocs-name', name);
await secureStorage.writeSecureData('memberDocs-imgUrl', imgUrl);
print(await secureStorage.readSecureData('memberDocs-expiredAt'));
print(await secureStorage.readSecureData('memberDocs-name'));
print(await secureStorage.readSecureData('memberDocs-imgUrl'));
// ISI DESCRIPTION
// {
// "docToken": "bb5e12c77438f60da1f2ab6e566c5aeb6d03561bec3e5d588f7e240e4c164120",
// "recipients": [{
// "privyId": "AB1234",
// "type": "Reviewer",
// "signatoryStatus": "Completed"
// },
// {
// "privyId": "DE3456",
// "type": "Signer",
// "signatoryStatus": "Completed"
// }
// ],
// "documentStatus": "Completed",
// "urlDocument": "https://sign-sandbox.privy.id/doc/bb5e12c77438f60da1f2ab6e566c5aeb6d03561bec3e5d588f7e240e4c164120",
// "download": {
// "url": "http://api-sandbox.privy.id/document/6S7p0MVgdB-f9a360ab-6d47-41d8-881d-b4492bad49f8",
// "expiredAt": "2019-04-25T09:33:58+00:00"
// }}
} else {
throw Exception('Failed to get MemberDocsID');
}
}
}
This diff is collapsed.
import 'package:flutter/material.dart';
import 'package:fundex_app/api/api.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/my_flutter_app_icons.dart';
import 'package:fundex_app/pages/profile/all_agreement.dart';
......@@ -20,7 +21,7 @@ class _AkunState extends State<Akun> {
//
String userName;
String userRole;
String userProfilePic;
String userProfilePic = 'https://picsum.photos/250?image=9';
@override
void initState() {
......@@ -29,8 +30,10 @@ class _AkunState extends State<Akun> {
}
Future init() async {
final userName = await SecureStorage().readSecureData('userName') ?? '';
final userRole = await SecureStorage().readSecureData('userRole') ?? '';
final userName =
await SecureStorage().readSecureData('userName') ?? 'username';
final userRole =
await SecureStorage().readSecureData('userRole') ?? 'userrole';
var userProfilePic =
await SecureStorage().readSecureData('userProfilePic') ?? '';
setState(() {
......@@ -42,9 +45,16 @@ class _AkunState extends State<Akun> {
Widget buildImage() {
if (userProfilePic == '') {
return Image.network('https://picsum.photos/250?image=9');
return Icon(
Icons.account_circle,
size: 48,
);
} else {
return Image.network(userProfilePic);
return Image.network(
userProfilePic ?? '',
height: 48,
width: 48,
);
}
}
......@@ -99,6 +109,7 @@ class _AkunState extends State<Akun> {
Container(
margin: EdgeInsets.fromLTRB(16, 0, 0, 0),
child: ClipRRect(
key: Key('userPhoto'),
borderRadius: BorderRadius.circular(90),
child: buildImage(),
),
......@@ -114,7 +125,7 @@ class _AkunState extends State<Akun> {
Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Text(
userName,
userName ?? '',
key: Key('usernameText'),
style: TextStyle(
fontWeight: FontWeight.bold,
......@@ -126,7 +137,7 @@ class _AkunState extends State<Akun> {
Container(
padding: EdgeInsets.fromLTRB(0, 0, 0, 0),
child: Text(
userRole,
userRole ?? '',
key: Key('usertypeText'),
style: TextStyle(
fontWeight: FontWeight.bold,
......@@ -214,7 +225,10 @@ class _AkunState extends State<Akun> {
flex: 40,
child: Material(
child: InkWell(
onTap: () {
onTap: () async {
Api().getMemberDocsId();
Api().getMemberDocs(
await SecureStorage().readSecureData('idMemberDocs'));
Navigator.push(
context,
MaterialPageRoute(
......
This diff is collapsed.
This diff is collapsed.
// import 'package:flutter/material.dart';
// import 'package:flutter_test/flutter_test.dart';
// import 'package:fundex_app/pages/profile/all_agreement.dart';
// void main() {
// Widget createWidgetForTesting({Widget child}) {
// return MaterialApp(
// home: child,
// );
// }
// testWidgets('Testing Scaffold', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('scaffold')), findsOneWidget);
// });
// testWidgets('Testing appbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('appbar')), findsOneWidget);
// });
// testWidgets('Testing icon back', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('icon-back')), findsOneWidget);
// });
// testWidgets('Testing text perjanjian', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
// });
// testWidgets('Testing body', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('body')), findsOneWidget);
// });
// testWidgets('Testing margin container 0', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
// });
// testWidgets('Testing tabbar', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar')), findsOneWidget);
// });
// testWidgets('Testing tab semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-semua')), findsOneWidget);
// });
// testWidgets('Testing tab perlu tanda tangan', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tab-perluTandaTangan')), findsOneWidget);
// });
// testWidgets('Testing tabbar view', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('tabbar-view')), findsOneWidget);
// });
// testWidgets('Testing content tabbar semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('content-tabbar-semua')), findsOneWidget);
// });
// testWidgets('Testing Card Semua', (WidgetTester tester) async {
// await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
// expect(find.byKey(Key('card-semua')), findsWidgets);
// });
// }
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/profile/all_agreement.dart';
void main() {
Widget createWidgetForTesting({Widget child}) {
......@@ -81,39 +9,53 @@ void main() {
);
}
testWidgets('Testing bottom navigation bar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('bottomNavigationBar')), findsOneWidget);
testWidgets('Testing Scaffold', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('scaffold')), findsOneWidget);
});
testWidgets('Testing home icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('homeIcon')), findsOneWidget);
testWidgets('Testing appbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('appbar')), findsOneWidget);
});
testWidgets('Testing portfolio icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('portfolioIcon')), findsOneWidget);
testWidgets('Testing icon back', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('icon-back')), findsOneWidget);
});
testWidgets('Testing transaction icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('transactionIcon')), findsOneWidget);
testWidgets('Testing text perjanjian', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('text-perjanjian')), findsOneWidget);
});
testWidgets('Testing help icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('helpIcon')), findsOneWidget);
testWidgets('Testing body', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('body')), findsOneWidget);
});
testWidgets('Testing account icon on bottom navbar',
(WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: MainScreen()));
expect(find.byKey(Key('accountIcon')), findsOneWidget);
testWidgets('Testing margin container 0', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('marginContainer-0')), findsOneWidget);
});
}
testWidgets('Testing tabbar', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tabbar')), findsOneWidget);
});
testWidgets('Testing tab semua', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tab-semua')), findsOneWidget);
});
testWidgets('Testing tab perlu tanda tangan', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tab-perluTandaTangan')), findsOneWidget);
});
testWidgets('Testing tabbar view', (WidgetTester tester) async {
await tester.pumpWidget(createWidgetForTesting(child: AllAgreement()));
expect(find.byKey(Key('tabbar-view')), findsOneWidget);
});
}
import 'package:flutter/material.dart';
// import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fundex_app/pages/kyc/biodata_pendukung.dart';
void main() {
testWidgets('test berjalannya page', (WidgetTester tester) async{
final latarBelakang = find.byKey(Key('latarBelakangPend'));
final pekerjaan = find.byKey(Key('pekerjaan'));
final namaPerusahaan = find.byKey(Key('namaPerusahaan'));
final bidangUsaha = find.byKey(Key('bidangUsaha'));
final alamatKantor = find.byKey(Key('alamatKantor'));
final jabatan = find.byKey(Key('jabatan'));
final noTelepon = find.byKey(Key('noTelepon'));
final emailKantor = find.byKey(Key('emailKantor'));
final tujuanInvestasi = find.byKey(Key('tujuanInvestasi'));
final loremIpsum = find.byKey(Key('loremIpsum'));
final sebelumnyaButton = find.byKey(Key('sebelumnyaButton'));
final selanjutnyaButton = find.byKey(Key('selanjutnyaButton'));
final listVIewCheckbox = find.byKey(Key('listViewCheckbox'));
await tester.pumpWidget(MaterialApp(
home: DataPendukung(),
));
await tester.tap(latarBelakang);
await tester.enterText(latarBelakang, 'gabut');
await tester.tap(pekerjaan);
await tester.enterText(pekerjaan, 'mahasiswa');
await tester.tap(namaPerusahaan);
await tester.enterText(namaPerusahaan, 'pt maju terus pantang mundur');
await tester.tap(bidangUsaha);
await tester.enterText(bidangUsaha, 'ternak');
await tester.tap(alamatKantor);
await tester.enterText(alamatKantor, 'jl. jalan');
await tester.tap(jabatan);
await tester.enterText(jabatan, 'OB');
await tester.tap(noTelepon);
await tester.enterText(noTelepon, '0987654321');
await tester.tap(emailKantor);
await tester.enterText(emailKantor, 'asd@as.com');
await tester.tap(tujuanInvestasi);
await tester.enterText(tujuanInvestasi, 'muter uang');
expect(loremIpsum, findsOneWidget);
expect(listVIewCheckbox, findsOneWidget);
expect(sebelumnyaButton, findsOneWidget);
expect(selanjutnyaButton, findsOneWidget);
});
testWidgets('Page mempunyai app bar', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.byType(IconButton), findsOneWidget);
expect(find.byIcon(Icons.arrow_back), findsOneWidget);
expect(find.text('e-KYC Pemodal'), findsOneWidget);
});
testWidgets('IconButton AppBar size', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
final RenderBox barBox = tester.renderObject(find.byType(AppBar));
final RenderBox iconBox = tester.renderObject(find.byType(IconButton));
expect(iconBox.size.height, isNot(barBox.size.height));
});
testWidgets('Terdapat Checkpoint', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.byKey(Key('checkpoint')), findsOneWidget);
expect(find.byKey(Key("container garis bulat checkpoint")), findsOneWidget);
expect(find.byKey(Key("container text checkpoint")), findsOneWidget);
expect(find.byKey(Key("line")), findsOneWidget);
});
testWidgets('Terdapat 5 icon checklist', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
// testWidgets('test berjalannya page', (WidgetTester tester) async{
// final latarBelakang = find.byKey(Key('latarBelakangPend'));
// // final pekerjaan = find.byKey(Key('pekerjaan'));
// final namaPerusahaan = find.byKey(Key('namaPerusahaan'));
// final bidangUsaha = find.byKey(Key('bidangUsaha'));
// final alamatKantor = find.byKey(Key('alamatKantor'));
// final jabatan = find.byKey(Key('jabatan'));
// final noTelepon = find.byKey(Key('noTelepon'));
// final emailKantor = find.byKey(Key('emailKantor'));
// final tujuanInvestasi = find.byKey(Key('tujuanInvestasi'));
// final loremIpsum = find.byKey(Key('loremIpsum'));
// final sebelumnyaButton = find.byKey(Key('sebelumnyaButton'));
// final selanjutnyaButton = find.byKey(Key('selanjutnyaButton'));
// final listVIewCheckbox = find.byKey(Key('listViewCheckbox'));
// await tester.pumpWidget(MaterialApp(
// home: DataPendukung(),
// ));
// await tester.tap(latarBelakang);
// // await tester.tap(pekerjaan);
// await tester.tap(namaPerusahaan);
// await tester.enterText(namaPerusahaan, 'pt maju terus pantang mundur');
// await tester.tap(bidangUsaha);
// await tester.enterText(bidangUsaha, 'ternak');
// await tester.tap(alamatKantor);
// await tester.enterText(alamatKantor, 'jl. jalan');
// await tester.tap(jabatan);
// await tester.enterText(jabatan, 'OB');
// await tester.tap(noTelepon);
// await tester.enterText(noTelepon, '0987654321');
// await tester.tap(emailKantor);
// await tester.enterText(emailKantor, 'asd@as.com');
// await tester.tap(tujuanInvestasi);
// await tester.enterText(tujuanInvestasi, 'muter uang');
// await tester.fling(
// find.byKey(Key("scroll")),
// const Offset(0.0, -10.0),
// 10,
// );
// expect(loremIpsum, findsOneWidget);
// expect(listVIewCheckbox, findsOneWidget);
// expect(sebelumnyaButton, findsOneWidget);
// expect(selanjutnyaButton, findsOneWidget);
// });
// testWidgets('Page mempunyai app bar', (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp(home: DataPendukung()));
// expect(find.byType(IconButton), findsOneWidget);
// expect(find.byIcon(Icons.arrow_back), findsOneWidget);
// expect(find.text('e-KYC Pemodal'), findsOneWidget);
// });
// testWidgets('IconButton AppBar size', (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp(home: DataPendukung()));
// final RenderBox barBox = tester.renderObject(find.byType(AppBar));
// final RenderBox iconBox = tester.renderObject(find.byType(IconButton));
// expect(iconBox.size.height, isNot(barBox.size.height));
// });
// testWidgets('Terdapat Checkpoint', (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp(home: DataPendukung()));
// expect(find.byKey(Key('checkpoint')), findsOneWidget);
// expect(find.byKey(Key("container garis bulat checkpoint")), findsOneWidget);
// expect(find.byKey(Key("container text checkpoint")), findsOneWidget);
// expect(find.byKey(Key("line")), findsOneWidget);
// });
// testWidgets('Terdapat 5 icon checklist', (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.byIcon(Icons.check_outlined), findsNWidgets(5));
});
testWidgets('Terdapat text pada container form', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.byKey(Key('teksDataPendukung')), findsOneWidget);
expect(find.text('Latar Belakang Pendidikan *'), findsOneWidget);
expect(find.text('Sumber Penghasilan *'), findsOneWidget);
expect(find.text('Pekerjaan'), findsOneWidget);
expect(find.text('Nama Perusahaan'), findsOneWidget);
expect(find.text('Bidang Usaha'), findsOneWidget);
expect(find.text('Alamat Kantor'), findsOneWidget);
expect(find.text('Jabatan'), findsOneWidget);
expect(find.text('Nomor Telepon Kantor'), findsOneWidget);
expect(find.text('Email Kantor *'), findsOneWidget);
expect(find.text('Tujuan Investasi *'), findsOneWidget);
expect(find.byKey(Key('loremIpsum')), findsOneWidget);
expect(find.text('Saya menjamin keaslian data yang telah diberikan. Dengan ini saya menyatakan telah menyutujui syarat dan ketentuan yang berlaku.'), findsOneWidget);
expect(find.text('Sebelumnya'), findsOneWidget);
expect(find.text('Selanjutnya'), findsOneWidget);
});
// expect(find.byIcon(Icons.check_outlined), findsNWidgets(5));
// });
// testWidgets('Terdapat text pada container form', (WidgetTester tester) async {
// await tester.pumpWidget(MaterialApp(home: DataPendukung()));
// expect(find.byKey(Key('teksDataPendukung')), findsOneWidget);
// expect(find.text('Latar Belakang Pendidikan *'), findsOneWidget);
// expect(find.text('Sumber Penghasilan *'), findsOneWidget);
// expect(find.text('Pekerjaan *'), findsOneWidget);
// expect(find.text('Nama Perusahaan'), findsOneWidget);
// expect(find.text('Bidang Usaha'), findsOneWidget);
// expect(find.text('Alamat Kantor'), findsOneWidget);
// expect(find.text('Jabatan'), findsOneWidget);
// expect(find.text('Nomor Telepon Kantor'), findsOneWidget);
// expect(find.text('Email Kantor *'), findsOneWidget);
// expect(find.text('Tujuan Investasi *'), findsOneWidget);
// expect(find.byKey(Key('loremIpsum')), findsOneWidget);
// expect(find.text('Saya menjamin keaslian data yang telah diberikan. Dengan ini saya menyatakan telah menyutujui syarat dan ketentuan yang berlaku.'), findsOneWidget);
// expect(find.text('Sebelumnya'), findsOneWidget);
// expect(find.text('Selanjutnya'), findsOneWidget);
// });
test('Field kosong', (){
var tes = Validasi.validate('');
......@@ -118,35 +121,45 @@ void main() {
expect(tes, null);
});
testWidgets('Button selanjutnya', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.text("Gaji"), findsOneWidget);
expect(find.text("Hibah"), findsOneWidget);
expect(find.text("Pasangan, Orang Tua, Keluarga atau Teman"), findsOneWidget);
expect(find.text("Santunan (Dana Pensiun, Donatur, Asuransi)"), findsOneWidget);
expect(find.text("Hasil Usaha"), findsOneWidget);
expect(find.text("Warisan"), findsOneWidget);
expect(find.text("Hasil Investasi (Bunga, Capital Gain, Dividen)"), findsOneWidget);
expect(find.text("Undian / Hadiah"), findsOneWidget);
test('Latar belakang valid', (){
var tes = ValidasiTempat.validate('SD');
expect(tes, null);
});