Fix: Perbaikan pilihan provinsi tidak dapat dipilih pada form edit Suku#694
Open
habibie11 wants to merge 1 commit into
Open
Fix: Perbaikan pilihan provinsi tidak dapat dipilih pada form edit Suku#694habibie11 wants to merge 1 commit into
habibie11 wants to merge 1 commit into
Conversation
|
🔄 AI PR Review sedang antri di server...
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
issue #696
🎯 Deskripsi
Pull request ini memperbaiki bug pada antarmuka pengguna (UI) di halaman edit data Suku (
/suku/{id}/edit), di mana daftar provinsi berhasil tampil di dropdown pencarian namun opsi provinsi tersebut tidak dapat dipilih (diklik) oleh pengguna.Penyebab utamanya adalah kesalahan pemetaan (mapping) properti pada respons JSON dari API
WilayahController::listWilayah. Frontend mencoba membaca nilai dariitem.region_codeyang bernilaiundefined, padahal API mengembalikan atribut dengan namakode_prov.Dengan memperbaiki kunci pemetaan pada Javascript dari
id: item.region_codemenjadiid: item.kode_prov, opsi dropdown sekarang mendapatkan ID yang valid sehingga bisa diklik dan disimpan dengan sempurna.Selain itu, PR ini menyertakan pembuatan Test E2E (End-to-End) menggunakan Playwright untuk memvalidasi alur interaksi Select2 di halaman edit Suku guna mencegah regresi di masa mendatang.
🛠️ Perubahan yang Dilakukan
1.
resources/views/admin/suku/edit.blade.phpFix — Koreksi pemetaan atribut ID Select2 provinsi:
item.region_code(yang tidak ada pada respon list_wilayah) menjadiitem.kode_prov.processResults: function(response) { return { results: $.map(response.results, function(item) { return { - id: item.region_code, + id: item.kode_prov, text: item.nama_prov, } }),2.
tests/e2e/suku.spec.jsTest — Penambahan dan perbaikan Test E2E untuk Edit Suku:
firstOrCreatemelaluiartisan tinker(mencakup data relasiRegiondanWilayahAdat).api/wilayah/list_wilayahdanapi/wilayah/adat/{id}untuk menjamin isolasi tes, kecepatan eksekusi, serta mencegah kegagalan akibat error404 Not Foundatau token yang tidak cocok di lingkungan testing.✅ Test Cases yang Diimplementasikan
suku.spec.js) dieksekusi dengan sukses dan seluruh pengujian (assertions) lolos tanpa adanya timeout atau elemen yang gagal dipilih.📸 Cara Menjalankan Uji Coba Manual
/suku).📸 Screenshot atau Video
sebelum
a43212a2-c6be-4b93-98ca-4f5217bd8463.webm
sesudah
b8f06f2d-d0a0-4196-a66e-a867ecfc25a6.webm
hasil test E2E
