mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-05-03 16:24:55 +00:00
🔥 **Cleanup:** Removed BookCase and OrangePill models, factories, migrations, and related references. Added tests for new service and meetup creation flows. Updated PHPUnit settings and browser-specific configurations.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Livewire\Livewire;
|
||||
|
||||
it('deletes the user and logs them out when password is correct', function () {
|
||||
$user = actingAsUser(['password' => Hash::make('correct-password')]);
|
||||
|
||||
Livewire::test('settings.delete-user-form')
|
||||
->set('password', 'correct-password')
|
||||
->call('deleteUser')
|
||||
->assertHasNoErrors()
|
||||
->assertRedirect('/');
|
||||
|
||||
expect(User::query()->find($user->id))->toBeNull();
|
||||
expect(auth()->check())->toBeFalse();
|
||||
});
|
||||
|
||||
it('does not delete the user with an incorrect password', function () {
|
||||
$user = actingAsUser(['password' => Hash::make('correct-password')]);
|
||||
|
||||
Livewire::test('settings.delete-user-form')
|
||||
->set('password', 'wrong-password')
|
||||
->call('deleteUser')
|
||||
->assertHasErrors(['password' => 'current_password']);
|
||||
|
||||
expect(User::query()->find($user->id))->not->toBeNull();
|
||||
});
|
||||
Reference in New Issue
Block a user