Added the support for generating docs from template doc

This commit is contained in:
Simon Pocrnjič
2025-10-06 21:46:28 +02:00
parent 0c8d1e0b5d
commit cec5796acf
69 changed files with 4570 additions and 374 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
namespace Tests\Feature;
use App\Models\Activity;
use App\Models\Client;
use App\Models\Document;
use App\Models\FieldJob;
use App\Models\Import;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class DashboardTest extends TestCase
{
use RefreshDatabase;
public function test_dashboard_returns_kpis_and_trends(): void
{
$user = User::factory()->create();
$this->actingAs($user);
Client::factory()->create();
Document::factory()->create();
FieldJob::factory()->create();
Import::factory()->create(['status' => 'queued']);
Activity::factory()->create();
$response = $this->get('/dashboard');
$response->assertSuccessful();
$props = $response->inertiaProps();
$this->assertArrayHasKey('kpis', $props);
$this->assertArrayHasKey('trends', $props);
foreach (['clients_total','clients_new_7d','field_jobs_today','documents_today','active_imports','active_contracts'] as $k) {
$this->assertArrayHasKey($k, $props['kpis']);
}
foreach (['clients_new','documents_new','field_jobs','imports_new','labels'] as $k) {
$this->assertArrayHasKey($k, $props['trends']);
}
}
}