QM-Startseite: Einführungstext, Hauptansprechpartner, QM-Beauftragte
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m47s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m6s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m7s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m3s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 3m56s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m26s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m34s
CI / Build-Artefakte aktuell (pull_request) Successful in 54s

- Pflege unter QM-Einstellungen → „Startseite des Qualitätsmanagements“
- QM-Beauftragte mit Zuständigkeit und optionalem Ordner-Link,
  Kontaktangaben wie bei den Ansprechpartnern

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 16:17:17 +00:00
parent b3a057e27c
commit 5a360d3cc7
95 changed files with 550 additions and 373 deletions

View file

@ -10,6 +10,7 @@ use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Facades\Storage;
use Inertia\Testing\AssertableInertia as Assert;
use Inhaus\Plugins\Qm\Filament\Pages\QmSettings;
use Inhaus\Plugins\Qm\Indexer;
use Inhaus\Plugins\Qm\Models\QmCategory;
use Inhaus\Plugins\Qm\Models\QmEntry;
@ -19,6 +20,7 @@ use Inhaus\Plugins\Qm\Presenter;
use Inhaus\Plugins\Qm\QmAccess;
use Inhaus\Plugins\Qm\QmTree;
use Inhaus\Plugins\Qm\Text\Ocr;
use Livewire\Livewire;
use Tests\TestCase;
use ZipArchive;
@ -110,6 +112,48 @@ class QmTest extends TestCase
$this->assertSame(['name' => 'users'], $node['icon'], 'Symbol wird vererbt');
}
public function test_start_page_with_intro_main_contacts_and_qm_officers(): void
{
$lead = User::factory()->create(['first_name' => 'Petra', 'last_name' => 'Leitung', 'phone' => '+49 1']);
$care = User::factory()->create(['first_name' => 'Klaus', 'last_name' => 'Pflege']);
$gone = User::factory()->inactive()->create();
$settings = app(Settings::class);
$settings->set(Presenter::HOME_INTRO, '<p>Willkommen im <em>QM</em></p><script>x()</script>');
$settings->set(Presenter::HOME_CONTACTS, [$lead->id]);
$settings->set(Presenter::OFFICERS, [
['user_id' => $care->id, 'area' => 'Pflege', 'folder_id' => $this->personal->id],
['user_id' => $gone->id, 'area' => 'Alt', 'folder_id' => null],
['user_id' => $lead->id, 'area' => null, 'folder_id' => 99999],
]);
$this->actingAs(User::factory()->create())->get('/qm')->assertInertia(fn (Assert $p) => $p
->where('intro', fn ($html) => str_contains($html, '<em>QM</em>') && ! str_contains($html, 'script'))
->where('contacts.0.name', 'Petra Leitung')
->has('officers', 2)
->where('officers.0.name', 'Klaus Pflege')
->where('officers.0.area', 'Pflege')
->where('officers.0.folder.path', 'Personal')
->where('officers.1.folder', null));
}
public function test_admin_maintains_the_start_page(): void
{
$lead = User::factory()->create();
$this->actingAs($this->qmb);
Livewire::test(QmSettings::class)
->set('data.home_intro', '<p>Hallo</p>')
->set('data.home_contacts', [(string) $lead->id])
->set('data.officers', ['a' => ['user_id' => (string) $lead->id, 'area' => 'Küche', 'folder_id' => (string) $this->personal->id]])
->call('save')
->assertHasNoErrors();
$settings = app(Settings::class);
$this->assertStringContainsString('Hallo', $settings->get(Presenter::HOME_INTRO));
$this->assertSame([$lead->id], $settings->get(Presenter::HOME_CONTACTS));
$this->assertSame([['user_id' => $lead->id, 'area' => 'Küche', 'folder_id' => $this->personal->id]], $settings->get(Presenter::OFFICERS));
}
public function test_folder_page_with_intro_contacts_subfolders_and_entries(): void
{
$anna = User::factory()->create(['first_name' => 'Anna', 'last_name' => 'Schmidt', 'phone' => '+49 40 123', 'job_title' => 'Personalleitung', 'location' => 'Hamburg']);