This commit is contained in:
2026-07-21 23:39:19 +02:00
commit b33b217bdb
217 changed files with 32076 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
<?php
use App\Livewire\Admin\Panel;
use App\Models\Ticket;
use App\Models\User;
use Livewire\Livewire;
test('every page renders without error against fully seeded data', function () {
$this->seed();
$client = User::query()->withRole('client')->firstOrFail();
$operator = User::query()->withRole('operator')->firstOrFail();
$admin = User::query()->withRole('admin')->firstOrFail();
$clientTicket = Ticket::query()->where('customer_id', $client->id)->firstOrFail();
$anyTicket = Ticket::query()->firstOrFail();
$this->get('/')->assertOk()->assertSee('Jak możemy pomóc');
$this->get('/login')->assertOk()->assertSee('Nowe zgłoszenie bez logowania');
$this->actingAs($client)->get('/client')->assertOk()->assertSee('Moje zgłoszenia')->assertSee('Panel Klienta');
$this->actingAs($client)->get('/client/new')->assertOk()->assertSee('Panel Klienta');
$this->actingAs($client)->get(route('client.ticket', $clientTicket))->assertOk()->assertSee($clientTicket->subject)->assertSee('Panel Klienta');
$this->actingAs($operator)->get('/operator')->assertOk()->assertSee('Otwarte')->assertSee('Panel Operatora');
$this->actingAs($operator)->get('/operator/new')->assertOk()->assertSee($client->email)->assertSee('Panel Operatora');
$this->actingAs($operator)->get(route('operator.ticket', $anyTicket))->assertOk()->assertSee($anyTicket->subject)->assertSee('Panel Operatora');
foreach (['categories', 'fields', 'users', 'teams', 'user-fields', 'reply-quick-actions', 'response-templates', 'statuses', 'priorities', 'templates', 'branding', 'config', 'about'] as $tab) {
$this->actingAs($admin)->get('/admin')->assertOk()->assertSee('Panel Administratora');
Livewire::actingAs($admin)->test(Panel::class)
->call('setTab', $tab)
->assertOk();
}
});