Fakultas Ilmu Komputer UI

Commit c25c9830 authored by Zafir Rasyidi Taufik's avatar Zafir Rasyidi Taufik
Browse files

[GREEN] Try to fix error in pipeline

parent 64023c32
Pipeline #82135 passed with stage
in 16 minutes and 58 seconds
const KECAMATAN_VALUES: {label: string; value: string}[] = [
{ label: 'Beji', value: 'Beji' },
{ label: 'Bojongsari', value: 'Bojongsari' },
{ label: 'Cilodong', value: 'Cilodong' },
{ label: 'Cimanggis', value: 'Cimanggis' },
{ label: 'Cinere', value: 'Cinere' },
{ label: 'Cipayung', value: 'Cipayung' },
{ label: 'Limo', value: 'Limo' },
{ label: 'Pancoran Mas', value: 'Pancoran Mas' },
{ label: 'Sawangan', value: 'Sawangan' },
{ label: 'Sukmajaya', value: 'Sukmajaya' },
{ label: 'Tapos', value: 'Tapos' },
];
const KELURAHAN_VALUES: { [key: string]: {label: string; value: string}[] } = {
'Beji': [
{ label: 'Beji', value: 'Beji' },
{ label: 'Beji Timur', value: 'Beji Timur' },
{ label: 'Kemirimuka', value: 'Kemirimuka' },
{ label: 'Kukusan', value: 'Kukusan' },
{ label: 'Pondok Cina', value: 'Pondok Cina' },
{ label: 'Tanah Baru', value: 'Tanah Baru' },
],
'Bojongsari': [
{ label: 'Bojongsari Baru', value: 'Bojongsari Baru' },
{ label: 'Bojongsari Lama', value: 'Bojongsari Lama' },
{ label: 'Curug', value: 'Curug' },
{ label: 'Duren Mekar', value: 'Duren Mekar' },
{ label: 'Duren Seribu', value: 'Duren Seribu' },
{ label: 'Pondok Petir', value: 'Pondok Petir' },
{ label: 'Serua', value: 'Serua' },
],
'Cilodong': [
{ label: 'Cilodong', value: 'Cilodong' },
{ label: 'Jatimulya', value: 'Jatimulya' },
{ label: 'Kalibaru', value: 'Kalibaru' },
{ label: 'Kalimulya', value: 'Kalimulya' },
{ label: 'Sukamaju', value: 'Sukamaju' },
],
'Cimanggis': [
{ label: 'Cisalak Pasar', value: 'Cisalak Pasar' },
{ label: 'Curug', value: 'Curug' },
{ label: 'Harjamukti', value: 'Harjamukti' },
{ label: 'Mekarsari', value: 'Mekarsari' },
{ label: 'Pasir Gunung Selatan', value: 'Pasir Gunung Selatan' },
{ label: 'Tugu', value: 'Tugu' },
],
'Cinere': [
{ label: 'Cinere', value: 'Cinere' },
{ label: 'Gandul', value: 'Gandul' },
{ label: 'Pangkalan Jati', value: 'Pangkalan Jati' },
{ label: 'Pangkalan Jati Baru', value: 'Pangkalan Jati Baru' },
],
'Cipayung': [
{ label: 'Bojong Pondok Terong', value: 'Bojong Pondok Terong' },
{ label: 'Cipayung', value: 'Cipayung' },
{ label: 'Cipayung Jaya', value: 'Cipayung Jaya' },
{ label: 'Pondok Jaya', value: 'Pondok Jaya' },
{ label: 'Ratujaya', value: 'Ratujaya' },
],
'Limo': [
{ label: 'Grogol', value: 'Grogol' },
{ label: 'Krukut', value: 'Krukut' },
{ label: 'Limo', value: 'Limo' },
{ label: 'Meruyung', value: 'Meruyung' },
],
'Pancoran Mas': [
{ label: 'Depok', value: 'Depok' },
{ label: 'Depok Jaya', value: 'Depok Jaya' },
{ label: 'Mampang', value: 'Mampang' },
{ label: 'Pancoran Mas', value: 'Pancoran Mas' },
{ label: 'Rangkapan Jaya', value: 'Rangkapan Jaya' },
{ label: 'Rangkapan Jaya Baru', value: 'Rangkapan Jaya Baru' },
],
'Sawangan': [
{ label: 'Bedahan', value: 'Bedahan' },
{ label: 'Cinangka', value: 'Cinangka' },
{ label: 'Kedaung', value: 'Kedaung' },
{ label: 'Pasir Putih', value: 'Pasir Putih' },
{ label: 'Pengasinan', value: 'Pengasinan' },
{ label: 'Sawangan Baru', value: 'Sawangan Baru' },
{ label: 'Sawangan Lama', value: 'Sawangan Lama' },
],
'Sukmajaya': [
{ label: 'Abadijaya', value: 'Abadijaya' },
{ label: 'Bakti Jaya', value: 'Bakti Jaya' },
{ label: 'Cisalak', value: 'Cisalak' },
{ label: 'Mekar Jaya', value: 'Mekar Jaya' },
{ label: 'Sukmajaya', value: 'Sukmajaya' },
{ label: 'Tirtajaya', value: 'Tirtajaya' },
],
'Tapos': [
{ label: 'Cilangkap', value: 'Cilangkap' },
{ label: 'Cimpaeun', value: 'Cimpaeun' },
{ label: 'Jatijajar', value: 'Jatijajar' },
{ label: 'Leuwinanggung', value: 'Leuwinanggung' },
{ label: 'Sukamaju Baru', value: 'Sukamaju Baru' },
{ label: 'Sukatani', value: 'Sukatani' },
{ label: 'Tapos', value: 'Tapos' },
],
};
{label: 'Beji', value: 'Beji'},
{label: 'Bojongsari', value: 'Bojongsari'},
{label: 'Cilodong', value: 'Cilodong'},
{label: 'Cimanggis', value: 'Cimanggis'},
{label: 'Cinere', value: 'Cinere'},
{label: 'Cipayung', value: 'Cipayung'},
{label: 'Limo', value: 'Limo'},
{label: 'Pancoran Mas', value: 'Pancoran Mas'},
{label: 'Sawangan', value: 'Sawangan'},
{label: 'Sukmajaya', value: 'Sukmajaya'},
{label: 'Tapos', value: 'Tapos'},
];
const KELURAHAN_VALUES: {label: string; value: string}[] = [
{label: 'Beji', value: 'Beji'},
{label: 'Beji Timur', value: 'Beji Timur'},
{label: 'Kemirimuka', value: 'Kemirimuka'},
{label: 'Kukusan', value: 'Kukusan'},
{label: 'Pondok Cina', value: 'Pondok Cina'},
{label: 'Tanah Baru', value: 'Tanah Baru'},
{label: 'Bojongsari Baru', value: 'Bojongsari Baru'},
{label: 'Bojongsari Lama', value: 'Bojongsari Lama'},
{label: 'Curug', value: 'Curug'},
{label: 'Duren Mekar', value: 'Duren Mekar'},
{label: 'Duren Seribu', value: 'Duren Seribu'},
{label: 'Pondok Petir', value: 'Pondok Petir'},
{label: 'Serua', value: 'Serua'},
{label: 'Cilodong', value: 'Cilodong'},
{label: 'Jatimulya', value: 'Jatimulya'},
{label: 'Kalibaru', value: 'Kalibaru'},
{label: 'Kalimulya', value: 'Kalimulya'},
{label: 'Sukamaju', value: 'Sukamaju'},
{label: 'Cisalak Pasar', value: 'Cisalak Pasar'},
{label: 'Curug', value: 'Curug'},
{label: 'Harjamukti', value: 'Harjamukti'},
{label: 'Mekarsari', value: 'Mekarsari'},
{label: 'Pasir Gunung Selatan', value: 'Pasir Gunung Selatan'},
{label: 'Tugu', value: 'Tugu'},
{label: 'Cinere', value: 'Cinere'},
{label: 'Gandul', value: 'Gandul'},
{label: 'Pangkalan Jati', value: 'Pangkalan Jati'},
{label: 'Pangkalan Jati Baru', value: 'Pangkalan Jati Baru'},
{label: 'Bojong Pondok Terong', value: 'Bojong Pondok Terong'},
{label: 'Cipayung', value: 'Cipayung'},
{label: 'Cipayung Jaya', value: 'Cipayung Jaya'},
{label: 'Pondok Jaya', value: 'Pondok Jaya'},
{label: 'Ratujaya', value: 'Ratujaya'},
{label: 'Grogol', value: 'Grogol'},
{label: 'Krukut', value: 'Krukut'},
{label: 'Limo', value: 'Limo'},
{label: 'Meruyung', value: 'Meruyung'},
{label: 'Depok', value: 'Depok'},
{label: 'Depok Jaya', value: 'Depok Jaya'},
{label: 'Mampang', value: 'Mampang'},
{label: 'Pancoran Mas', value: 'Pancoran Mas'},
{label: 'Rangkapan Jaya', value: 'Rangkapan Jaya'},
{label: 'Rangkapan Jaya Baru', value: 'Rangkapan Jaya Baru'},
{label: 'Bedahan', value: 'Bedahan'},
{label: 'Cinangka', value: 'Cinangka'},
{label: 'Kedaung', value: 'Kedaung'},
{label: 'Pasir Putih', value: 'Pasir Putih'},
{label: 'Pengasinan', value: 'Pengasinan'},
{label: 'Sawangan Baru', value: 'Sawangan Baru'},
{label: 'Sawangan Lama', value: 'Sawangan Lama'},
{label: 'Abadijaya', value: 'Abadijaya'},
{label: 'Bakti Jaya', value: 'Bakti Jaya'},
{label: 'Cisalak', value: 'Cisalak'},
{label: 'Mekar Jaya', value: 'Mekar Jaya'},
{label: 'Sukmajaya', value: 'Sukmajaya'},
{label: 'Tirtajaya', value: 'Tirtajaya'},
{label: 'Cilangkap', value: 'Cilangkap'},
{label: 'Cimpaeun', value: 'Cimpaeun'},
{label: 'Jatijajar', value: 'Jatijajar'},
{label: 'Leuwinanggung', value: 'Leuwinanggung'},
{label: 'Sukamaju Baru', value: 'Sukamaju Baru'},
{label: 'Sukatani', value: 'Sukatani'},
{label: 'Tapos', value: 'Tapos'},
];
const JENIS_KONTAK_VALUES: {label: string; value: string}[] = [
{label: 'Serumah', value: 'Serumah'},
......
......@@ -13,8 +13,6 @@ import ReactTestRenderer, { act } from 'react-test-renderer';
import {AppContext} from 'contexts';
import { KECAMATAN_VALUES, JENIS_KONTAK_VALUES, KELURAHAN_VALUES } from './constants';
jest.useFakeTimers();
const Stack = createStackNavigator();
const testPropsEdit = {
cache: {
......@@ -82,7 +80,7 @@ it('renders correctly', () => {
const jenisKontakField = instance.root.find(elem => elem.props.name === "Jenis Kontak");
expect(jenisKontakField).toBeTruthy();
expect(kelurahanField.props.value).toBe(KELURAHAN_VALUES[KECAMATAN_VALUES[0].value]);
expect(kelurahanField.props.value).toBe(KELURAHAN_VALUES[0].value);
expect(kecamatanField.props.value).toBe(KECAMATAN_VALUES[0].value);
expect(jenisKontakField.props.value).toBe(JENIS_KONTAK_VALUES[0].value);
});
......
......@@ -97,7 +97,7 @@ const ContactInvestigationFormStep2 = () => {
setField("sub_district", case_subject.sub_district)
setField("case_relation", case_relation)
} else {
setField("sub_district", KELURAHAN_VALUES[KECAMATAN_VALUES[0].value])
setField("sub_district", KELURAHAN_VALUES[0].value)
setField("district", KECAMATAN_VALUES[0].value)
setField("case_relation", JENIS_KONTAK_VALUES[0].value)
}
......@@ -157,20 +157,20 @@ const ContactInvestigationFormStep2 = () => {
/>
<Gap axis={2} gap={15} />
<Field
name="Kelurahan"
value={form.fields.sub_district.value || KELURAHAN_VALUES[0].value}
type={Field.Type.Dropdown}
name="Kecamatan"
isRequired
value={form.fields.district.value || KECAMATAN_VALUES[0].value}
updateValue={val => onFormChange('district', val)}
values={KECAMATAN_VALUES}
values={KELURAHAN_VALUES}
updateValue={val => onFormChange('sub_district', val)}
/>
<Field
type={Field.Type.Dropdown}
name="Kelurahan"
name="Kecamatan"
isRequired
value={form.fields.sub_district.value || KELURAHAN_VALUES[KECAMATAN_VALUES[0].value][0].value}
updateValue={val => onFormChange('sub_district', val)}
values={(form.fields.district.value) ? KELURAHAN_VALUES[form.fields.district.value] : KELURAHAN_VALUES[KECAMATAN_VALUES[0].value]}
value={form.fields.district.value || KECAMATAN_VALUES[0].value}
type={Field.Type.Dropdown}
values={KECAMATAN_VALUES}
updateValue={val => onFormChange('district', val)}
/>
<Field
name="Jenis Kontak"
......
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