Feat: smoketest SOTK#1068
Open
pandigresik wants to merge 52 commits into
Open
Conversation
- Upgrade composer deps melalui 3 fase (L10→L11→L12→L13) - Bump 12 package ke major version baru (slug, datatables, CSP, image, dll) - Migrasi Intervention Image v2→v3 (Image::make → read, resize → scale) - Migrasi Spatie CSP v2→v3 (Policy → Preset, addDirective → add, config format) - Tambah helper csp_nonce() (dihilangkan di CSP v3) - Tambah CspExclusion middleware untuk route exclusion - Publikasikan ulang config/image.php, config/jsvalidation.php - Update CustomCSPPolicy → CustomCspPreset implement Preset interface - Update CSP test untuk v3 API - Catat temuan post-upgrade di UPGRADE_LARAVEL_13_PLAN.md
…upgrade/laravel-13
…upgrade/laravel-13
…upgrade/laravel-13
|
🔄 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.
Pull Request: Smoke Test Modul SOTK (Departemen, Jabatan, Pejabat Daerah, Struktur Bagan)
Deskripsi
Menambahkan smoke test menggunakan Pest browser testing untuk memastikan fungsionalitas inti modul SOTK (Struktur Organisasi dan Tata Kerja) berjalan dengan benar. Test mengcover 4 submenu: Departemen, Jabatan, Pejabat Daerah, dan Struktur Bagan — mencakup keterbukaan halaman, ketersediaan tombol aksi, rendering datatable, dan keberadaan data minimal.
Perubahan yang dilakukan:
Department,Position,Employee: Menambahkan traitHasFactoryagar model dapat menggunakan factory untuk pembuatan data test.DepartmentFactory,PositionFactory, danEmployeeFactorydidatabase/factories/untuk menghasilkan data dummy yang diperlukan saat test berjalan.data-testidattributes: Menambahkan atributdata-testidpada elemen-elemen kunci di 6 file view:departments/index.blade.php:bt-tambah,bt-edit,bt-deletedepartments/table.blade.php:datatable-departmentspositions/index.blade.php:bt-tambah,bt-edit,bt-deletepositions/table.blade.php:datatable-positionsemployees/index.blade.php:bt-tambah,bt-edit,bt-deleteemployees/table.blade.php:datatable-employeesorgchart/index.blade.php:chart-container,bt-cetak(via JS setAttribute)tests/Browser/:SmokeDepartmentsTest.php(6 test cases)SmokePositionsTest.php(6 test cases)SmokeEmployeesTest.php(6 test cases)SmokeOrgchartTest.php(4 test cases)Alasan perubahan:
SmokePendudukTest,SmokeKelembagaanTest) menggunakan Pest browser testing denganSessionStateuntuk autentikasi.firstOrCreate()agar test tidak gagal karena database kosong, sekaligus tidak membuat duplikat data pada run berikutnya.Http::fake()karena membaca data dari database internal, bukan dari API eksternal.Dampak perubahan:
✅ Coverage bertambah: 22 test cases baru untuk modul SOTK
✅ Data-testid konsisten: Mengikuti konvensi yang sudah ada di project (
@bt-tambah,@datatable-*,@bt-edit,@bt-delete)✅ Idempotent: Menggunakan
firstOrCreate()sehingga aman dijalankan berulang kali✅ Tidak ada perubahan logic: Hanya penambahan atribut HTML dan test files — tidak mengubah perilaku aplikasi
Masalah Terkait (Related Issue)
Langkah untuk mereproduksi (Steps to Reproduce)
Menjalankan smoke test:
.env.testing)Test yang dijalankan per halaman:
Departemen (
/departments)@bt-tambah) tampil@datatable-departments) tampil@bt-edit) dan hapus (@bt-delete) pada data tampilJabatan (
/positions)@bt-tambah) tampil@datatable-positions) tampil@bt-edit) dan hapus (@bt-delete) pada data tampilPejabat Daerah (
/employees)@bt-tambah) tampil@datatable-employees) tampil@bt-edit) dan hapus (@bt-delete) pada data tampilStruktur Bagan (
/orgchart)@chart-container) ter-render@bt-cetak) tampilDaftar Periksa (Checklist)
Teknis Detail
File yang berubah
app/Models/Department.phpHasFactorytraitapp/Models/Position.phpHasFactorytraitapp/Models/Employee.phpHasFactorytraitdatabase/factories/DepartmentFactory.phpdatabase/factories/PositionFactory.phpdatabase/factories/EmployeeFactory.phpresources/views/departments/index.blade.phpdata-testidpada tombolresources/views/departments/table.blade.phpdata-testidpada tabelresources/views/positions/index.blade.phpdata-testidpada tombolresources/views/positions/table.blade.phpdata-testidpada tabelresources/views/employees/index.blade.phpdata-testidpada tombolresources/views/employees/table.blade.phpdata-testidpada tabelresources/views/orgchart/index.blade.phpdata-testidpada container & cetaktests/Browser/SmokeDepartmentsTest.phptests/Browser/SmokePositionsTest.phptests/Browser/SmokeEmployeesTest.phptests/Browser/SmokeOrgchartTest.phpPola testing yang digunakan
SessionState::loginAdminUser()untuk login sebagai adminModel::firstOrCreate()dibeforeEachuntuk memastikan data ada@data-testiduntuk elemen statis,assertScriptdengan polling JS untuk DataTable rows (karena data dimuat async via AJAX)SessionState::clear()diafterEachTotal test cases: 22
SmokeDepartmentsTest.phpSmokePositionsTest.phpSmokeEmployeesTest.phpSmokeOrgchartTest.phpScreenshots