feat: testing suite and bug fixes (Fasa 11)

- AuthTest, ProgramTest, CheckinTest, QuestionnaireTest, CertificateTest — 19 feature tests, 35 total pass
- ProgramFactory with published() state
- UserFactory: is_admin=true default, nonAdmin() state
- Fix attendance_source column name in StatisticsController (was: source)
- Fix route(dashboard) → route(admin.dashboard) in all Breeze auth controllers
- Remove irrelevant Breeze boilerplate tests (Profile, Example, Registration)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Saufi
2026-05-17 00:23:38 +08:00
parent a41ff59009
commit 700fbd1bcc
19 changed files with 493 additions and 187 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Database\Factories;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
class ProgramFactory extends Factory
{
public function definition(): array
{
return [
'title' => fake()->sentence(3),
'organizer' => fake()->company(),
'location' => fake()->city(),
'start_date' => now()->toDateString(),
'end_date' => now()->toDateString(),
'status' => 'draft',
'allow_walk_in' => true,
'default_staff_session' => 'pagi',
'default_external_session' => 'pagi',
'created_by' => User::factory(),
];
}
public function published(): static
{
return $this->state(fn () => ['status' => 'published']);
}
}