- 83 Komponenten: Livewire\Volt\Component → Livewire\Component
- 73 Routen (admin, auth, customer): Volt::route() → Route::livewire()
- 88 Testdateien: Volt::test/actingAs → Livewire::test/actingAs
- VoltServiceProvider gelöscht; composer remove livewire/volt
- config/livewire.php auf v4-Schlüssel (component_layout, component_placeholder,
component_locations, make_command: SFC ohne ⚡). Der alte Schlüssel layout war
wirkungslos; alle gerouteten Komponenten setzen ihr Layout selbst.
- CLAUDE.md, AGENTS.md, boost.json, .cursorrules, Skill volt-development
- Roadmap: erledigt; Larastan erfasst SFCs weiterhin nicht (Blade-Dateien)
Suite 2.325 grün, einer übersprungen; Larastan und Pint ohne Meldung;
route:cache und view:cache laufen.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2.2 KiB
PHP
79 lines
2.2 KiB
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
use Livewire\Livewire;
|
|
|
|
test('profile settings route redirects to the customer profile page', function () {
|
|
$this->actingAs(User::factory()->create());
|
|
|
|
// Das Profil ist seit dem Hub-/Customer-Portal-Umbau unter
|
|
// /admin/me/profile (route `me.profile`) erreichbar. /settings/profile
|
|
// bleibt als kanonischer Redirect bestehen. Das Rendern der Zielseite
|
|
// deckt CustomerProfileSecurityTest über die Volt-Komponente ab.
|
|
$this->get('/settings/profile')->assertRedirect('/admin/me/profile');
|
|
});
|
|
|
|
test('profile information can be updated', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('settings.profile')
|
|
->set('name', 'Test User')
|
|
->set('email', 'test@example.com')
|
|
->call('updateProfileInformation');
|
|
|
|
$response->assertHasNoErrors();
|
|
|
|
$user->refresh();
|
|
|
|
expect($user->name)->toEqual('Test User');
|
|
expect($user->email)->toEqual('test@example.com');
|
|
expect($user->email_verified_at)->toBeNull();
|
|
});
|
|
|
|
test('email verification status is unchanged when email address is unchanged', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('settings.profile')
|
|
->set('name', 'Test User')
|
|
->set('email', $user->email)
|
|
->call('updateProfileInformation');
|
|
|
|
$response->assertHasNoErrors();
|
|
|
|
expect($user->refresh()->email_verified_at)->not->toBeNull();
|
|
});
|
|
|
|
test('user can delete their account', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('settings.delete-user-form')
|
|
->set('password', 'password')
|
|
->call('deleteUser');
|
|
|
|
$response
|
|
->assertHasNoErrors()
|
|
->assertRedirect('/');
|
|
|
|
expect($user->fresh())->toBeNull();
|
|
expect(auth()->check())->toBeFalse();
|
|
});
|
|
|
|
test('correct password must be provided to delete account', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = Livewire::test('settings.delete-user-form')
|
|
->set('password', 'wrong-password')
|
|
->call('deleteUser');
|
|
|
|
$response->assertHasErrors(['password']);
|
|
|
|
expect($user->fresh())->not->toBeNull();
|
|
});
|