Fakultas Ilmu Komputer UI

Commit 6f9db570 authored by Muhammad Farhan Ghaffar's avatar Muhammad Farhan Ghaffar
Browse files

[RED] adding test for typeahead lata belakang

parents 5e7c1177 ec2c522a
Pipeline #78424 failed with stages
in 5 minutes and 50 seconds
......@@ -668,7 +668,7 @@
"languageVersion": "2.7"
}
],
"generated": "2021-05-21T10:39:42.736674Z",
"generated": "2021-05-23T11:22:33.542366Z",
"generator": "pub",
"generatorVersion": "2.13.0-116.0.dev"
"generatorVersion": "2.13.0"
}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\src\\\\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-21 18:23:16.202814","version":"2.1.0-12.1.pre"}
\ 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":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"android":[{"name":"flutter_keyboard_visibility","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility-5.0.0\\\\","dependencies":[]},{"name":"flutter_plugin_android_lifecycle","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_plugin_android_lifecycle-2.0.1\\\\","dependencies":[]},{"name":"flutter_secure_storage","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_secure_storage-3.3.5\\\\","dependencies":[]},{"name":"image_picker","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\image_picker-0.7.4\\\\","dependencies":["flutter_plugin_android_lifecycle"]},{"name":"path_provider","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider-2.0.1\\\\","dependencies":[]}],"macos":[{"name":"path_provider_macos","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_macos-2.0.0\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_linux-2.0.0\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\path_provider_windows-2.0.0\\\\","dependencies":[]}],"web":[{"name":"flutter_keyboard_visibility_web","path":"D:\\\\src\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.dartlang.org\\\\flutter_keyboard_visibility_web-2.0.0\\\\","dependencies":[]},{"name":"image_picker_for_web","path":"D:\\\\src\\\\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-23 19:46:38.615341","version":"2.1.0-12.1.pre"}
\ No newline at end of file
image: cirrusci/flutter:stable
image: cirrusci/flutter:2.0.6
stages:
- linter
- test_coverage
- sonar
- build_android
before_script:
- flutter pub get
- flutter clean
- flutter --version
# - build_android
lint:flutter:
stage: linter
......@@ -64,16 +59,16 @@ SonarScanner:
- staging
build_android:
stage: build_android
before_script:
- flutter packages get
- flutter clean
script:
- flutter build apk
artifacts:
paths:
- build/app/outputs/apk/release/app-release.apk
only:
- master
- staging
# build_android:
# stage: build_android
# before_script:
# - flutter packages get
# - flutter clean
# script:
# - flutter build apk
# artifacts:
# paths:
# - build/app/outputs/apk/release/app-release.apk
# only:
# - master
# - staging
......@@ -3,7 +3,7 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-05-21 17:39:42.692831.
# Generated by pub on 2021-05-23 18:22:33.477540.
_fe_analyzer_shared:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/_fe_analyzer_shared-14.0.0/lib/
analyzer:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.41.2/lib/
args:file:///D:/src/flutter/.pub-cache/hosted/pub.dartlang.org/args-2.0.0/lib/
......
// This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/ferdisungkar/flutter
FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape
FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart
FLUTTER_ROOT=D:\src\flutter
FLUTTER_APPLICATION_PATH=D:\farhan\ppl\a\ppl2021-d-slhape
COCOAPODS_PARALLEL_CODE_SIGN=true
FLUTTER_TARGET=lib\main.dart
FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios
SYMROOT=${SOURCE_ROOT}/../build\ios
FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1
DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue
EXCLUDED_ARCHS[sdk=iphonesimulator*]=arm64 i386
DART_OBFUSCATION=false
TRACK_WIDGET_CREATION=true
TRACK_WIDGET_CREATION=false
TREE_SHAKE_ICONS=false
PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json
PACKAGE_CONFIG=.packages
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/Users/ferdisungkar/flutter"
export "FLUTTER_APPLICATION_PATH=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape"
export "FLUTTER_TARGET=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/lib/main.dart"
export "FLUTTER_ROOT=D:\src\flutter"
export "FLUTTER_APPLICATION_PATH=D:\farhan\ppl\a\ppl2021-d-slhape"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "SYMROOT=${SOURCE_ROOT}/../build/ios"
export "SYMROOT=${SOURCE_ROOT}/../build\ios"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_DEFINES=flutter.inspector.structuredErrors%3Dtrue"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"
export "TRACK_WIDGET_CREATION=false"
export "TREE_SHAKE_ICONS=false"
export "PACKAGE_CONFIG=/Users/ferdisungkar/Desktop/Files/Universitas-Indonesia/Semester-6/PPL/Project/ppl2021-d-slhape/.dart_tool/package_config.json"
export "PACKAGE_CONFIG=.packages"
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:fundex_app/assets/colors.dart';
import 'package:fundex_app/main-screen.dart';
import 'package:fundex_app/pages/kyc/data_identitas.dart';
......@@ -24,12 +23,6 @@ class ValidasiEmail {
}
}
class ValidasiTempat{
static String validate(String value){
return value.isEmpty ? 'Tempat lahir harus di isi' : null;
}
}
class DataPendukung extends StatefulWidget {
@override
_DataPendukungState createState() => _DataPendukungState();
......@@ -37,8 +30,6 @@ class DataPendukung extends StatefulWidget {
class _DataPendukungState extends State<DataPendukung> {
final GlobalKey<FormState> _formkey = GlobalKey<FormState>();
final TextEditingController _typeAheadController = TextEditingController();
// final TextEditingController _typeAheadControllerInvestasi = TextEditingController();
// ignore: unused_field
String _latarBelakang;
......@@ -61,7 +52,6 @@ class _DataPendukungState extends State<DataPendukung> {
bool valueCheckbox = false;
bool _checkBox = false;
var _onPressed;
String dropdownValue;
final notifikasiCheckbox = [
CheckboxNotificationSetting(title: 'Gaji'),
......@@ -109,20 +99,6 @@ class _DataPendukungState extends State<DataPendukung> {
_onPressed = null;
}
List<String> listLatarBelakang(String query) {
List<String> matches = [];
matches.add("SD");
matches.add("SMP");
matches.add("SMA");
matches.add("D3");
matches.add("D4");
matches.add("S1");
matches.add("S2");
matches.add("S3");
matches.add("Lainnya");
matches.retainWhere((s) => s.toLowerCase().contains(query.toLowerCase()));
return matches;
}
return MaterialApp(
home: Scaffold(
......@@ -267,34 +243,6 @@ class _DataPendukungState extends State<DataPendukung> {
style: miniTitleTextStyle(),
),
),
Container(
width: 343,
child: TypeAheadFormField(
key: Key('typeahead'),
textFieldConfiguration: TextFieldConfiguration(
controller: this._typeAheadController,
decoration: formInputDecoration()
),
suggestionsCallback: (pattern) {
return listLatarBelakang(pattern);
},
itemBuilder: (context, suggestion) {
return ListTile(
title: Text(suggestion),
);
},
transitionBuilder: (context, suggestionsBox, controller) {
return suggestionsBox;
},
onSuggestionSelected: (suggestion) {
this._typeAheadController.text = suggestion;
},
// ignore: missing_return
validator: ValidasiTempat.validate,
onSaved: (value) => this._latarBelakang = value,
),
),
])
],
),
......
......@@ -25,13 +25,13 @@ dependencies:
sdk: flutter
test: '^1.15.7'
flutter_secure_storage: '^3.3.5'
http: '0.13.0'
http: 0.13.0
cupertino_icons: ^1.0.0
flutter_typeahead: '^3.1.0'
flutter_typeahead: ^3.1.0
intl: any
google_fonts: ^2.0.0
carousel_slider: ^3.0.0
percent_indicator: "^2.1.7+2"
percent_indicator: ^2.1.7+2
flutter_svg: ^0.19.3
dotted_border: ^1.0.7
image_picker: any
......@@ -45,9 +45,9 @@ dependencies:
dev_dependencies:
flutter_test:
sdk: flutter
mockito: '^4.1.4'
build_runner: '^1.0.0'
build_test: '^1.3.7'
mockito: ^4.1.4
build_runner: ^1.0.0
build_test: ^1.3.7
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
......
......@@ -23,7 +23,6 @@ void main() {
));
await tester.tap(latarBelakang);
await tester.enterText(latarBelakang, 'gabut');
await tester.tap(pekerjaan);
await tester.enterText(pekerjaan, 'mahasiswa');
await tester.tap(namaPerusahaan);
......@@ -123,6 +122,16 @@ void main() {
expect(tes, null);
});
test('Latar belakang valid', (){
var tes = ValidasiEmail.validate('SD');
expect(tes, null);
});
test('Field kosong', (){
var tes = Validasi.validate('');
expect(tes, 'Harus di isi.');
});
testWidgets('Button selanjutnya', (WidgetTester tester) async {
await tester.pumpWidget(MaterialApp(home: DataPendukung()));
expect(find.text("Gaji"), 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