profile test passes now

This commit is contained in:
2025-03-27 13:40:25 +00:00
parent a9b69d1a0e
commit a4f2dcf7fd
3 changed files with 34 additions and 1 deletions

View File

@@ -50,9 +50,27 @@ test('email verification status is unchanged when the email address is unchanged
expect($user->refresh()->email_verified_at)->not->toBeNull();
});
test('user is prevented from deleting their account if they own organisations', function () {
$user = User::factory()->create();
$response = $this
->actingAs($user)
->delete('/settings/profile', [
'password' => 'password',
]);
$response
->assertSessionHasErrors('password');
expect($user->fresh())->not->toBeNull();
});
test('user can delete their account', function () {
$user = User::factory()->create();
$user->ownedOrganisations()->delete();
$user->organisations()->delete();
$response = $this
->actingAs($user)
->delete('/settings/profile', [