im profil kann ein nutzer nun seine daten exportieren. man kann seinen account löschen. nach 2 jahren werden inaktive accounts gelöscht, 1 monat vorher wird eine email geschickt. Hilfetexte und Legal Pages in der Guest PWA korrigiert und vom layout her optimiert (dark mode).

This commit is contained in:
Codex Agent
2025-11-10 19:55:46 +01:00
parent 447a90a742
commit 2587b2049d
37 changed files with 1650 additions and 50 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace Tests\Feature;
use App\Jobs\AnonymizeAccount;
use App\Models\Tenant;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Queue;
use Illuminate\Support\Str;
use Tests\TestCase;
class ProfileAccountDeletionTest extends TestCase
{
use RefreshDatabase;
public function test_confirmation_is_required(): void
{
Queue::fake();
$tenant = Tenant::factory()->create();
$user = User::factory()->create(['tenant_id' => $tenant->id]);
$response = $this->actingAs($user)->delete('/profile/account', [
'confirmation' => 'WRONG',
]);
$response->assertSessionHasErrors('confirmation');
Queue::assertNothingPushed();
}
public function test_account_deletion_dispatches_job(): void
{
Queue::fake();
$tenant = Tenant::factory()->create();
$user = User::factory()->create(['tenant_id' => $tenant->id]);
$keyword = Str::upper(__('profile.delete.confirmation_keyword'));
$response = $this->actingAs($user)->delete('/profile/account', [
'confirmation' => $keyword,
]);
$response->assertRedirect('/profile');
Queue::assertPushed(AnonymizeAccount::class, function (AnonymizeAccount $job) use ($user) {
return $job->userId() === $user->id;
});
}
}