## Dokumentation - Entfernt AGENTS.md (redundant zu CLAUDE.md) - Verschoben: 3 Dokumentationen von root → docs/ - Gelöscht: 8 historische Migrations-Pläne aus docs/archive/ - Entfernt: misc/ Ordner komplett (43 Dateien) ## Struktur - Erstellt: database/queries/ für SQL Test-Queries (4 Dateien) - Erstellt: database/schemas/ für Schema-Dokumentation (17 Dateien) - output_keys_mapping/ (8 CSV-Mappings) - migration-diagrams/ (4 Diagramme) ## Code-Qualität - Formatiert: 7 Style-Issues in 74 Dateien mit Laravel Pint - Gefixed: Migration für PostgreSQL/SQLite Kompatibilität - Gefixed: 2 fehlgeschlagene Tests (CSRF + Text-Assertion) ## Tests - Alle 73 Tests bestehen jetzt (100% Success Rate) - AuthenticationTest: CSRF-Token Fix für Logout-Test - CompanySearchTest: Text-Assertion aktualisiert ## Ergebnis - Root ist sauber (nur CLAUDE.md) - Dokumentation strukturiert in docs/ - Database-Dateien organisiert in database/ - Code entspricht Style-Guide - Alle Tests bestehen
100 lines
2.6 KiB
PHP
100 lines
2.6 KiB
PHP
<?php
|
|
|
|
use App\Models\User;
|
|
|
|
it('requires authentication to access upload page', function () {
|
|
$response = $this->get('/upload');
|
|
|
|
$response->assertRedirect('/login');
|
|
});
|
|
|
|
it('can render upload page when authenticated', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('Upload neuer Transaktionen als CSV Datei')
|
|
->assertSee('Hochladen der Datei zur Verarbeitung durch die Trusted AI Plattform')
|
|
->assertSee('Select File')
|
|
->assertSee('Maximum file size: 50 MB')
|
|
->assertSee('https://upload.trai.mcs.local/api/upload')
|
|
->assertSee('Upload File')
|
|
->assertSee('Clear');
|
|
});
|
|
|
|
it('displays file input with correct attributes', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('type="file"', false)
|
|
->assertSee('id="file-upload"', false)
|
|
->assertSee('x-ref="fileInput"', false)
|
|
->assertSee('@change="selectFile"', false);
|
|
});
|
|
|
|
it('displays alpine.js data structure', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('x-data', false)
|
|
->assertSee('file: null', false)
|
|
->assertSee('uploading: false', false)
|
|
->assertSee('uploadStatus: null', false);
|
|
});
|
|
|
|
it('displays upload button with loading states', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('x-show="!uploading"', false)
|
|
->assertSee('Upload File')
|
|
->assertSee('x-show="uploading"', false)
|
|
->assertSee('Uploading...');
|
|
});
|
|
|
|
it('displays progress bar for upload state', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('x-show="uploading"', false)
|
|
->assertSee('Please wait while your file is being uploaded...');
|
|
});
|
|
|
|
it('displays callout for upload status messages', function () {
|
|
$user = User::factory()->create();
|
|
|
|
$this->actingAs($user);
|
|
|
|
$response = $this->get('/upload');
|
|
|
|
$response
|
|
->assertOk()
|
|
->assertSee('x-show="uploadStatus"', false)
|
|
->assertSee('x-bind:variant', false)
|
|
->assertSee('x-text="uploadMessage"', false);
|
|
});
|