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:
55
tests/Feature/ProfileDataExportTest.php
Normal file
55
tests/Feature/ProfileDataExportTest.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Jobs\GenerateDataExport;
|
||||
use App\Models\DataExport;
|
||||
use App\Models\Tenant;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ProfileDataExportTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase;
|
||||
|
||||
public function test_user_can_request_data_export(): void
|
||||
{
|
||||
Queue::fake();
|
||||
|
||||
$tenant = Tenant::factory()->create();
|
||||
$user = User::factory()->create(['tenant_id' => $tenant->id]);
|
||||
|
||||
$response = $this->actingAs($user)->post('/profile/data-exports');
|
||||
|
||||
$response->assertRedirect();
|
||||
$this->assertDatabaseCount('data_exports', 1);
|
||||
Queue::assertPushed(GenerateDataExport::class);
|
||||
}
|
||||
|
||||
public function test_ready_export_can_be_downloaded(): void
|
||||
{
|
||||
Storage::fake('local');
|
||||
|
||||
$tenant = Tenant::factory()->create();
|
||||
$user = User::factory()->create(['tenant_id' => $tenant->id]);
|
||||
|
||||
Storage::disk('local')->put('exports/demo.zip', 'demo-content');
|
||||
|
||||
$export = DataExport::create([
|
||||
'user_id' => $user->id,
|
||||
'tenant_id' => $tenant->id,
|
||||
'status' => DataExport::STATUS_READY,
|
||||
'path' => 'exports/demo.zip',
|
||||
'size_bytes' => 123,
|
||||
'expires_at' => now()->addDay(),
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->get(route('profile.data-exports.download', $export));
|
||||
|
||||
$response->assertOk();
|
||||
$response->assertHeader('content-disposition');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user