+ {{ formatShortDate(doc.updated_at) }} · {{ formatSize(doc.size) }} +
+{{ folderSummary(folder) }}
+{{ doc.description }}
++ {{ formatRelative(doc.updated_at) }} · {{ formatSize(doc.size) }} · {{ doc.folder_name }} +
+{{ person.department }}
+ {{ person.name }} +{{ person.job_title || '–' }}
+{{ details.job_title }}
+
+
{{ details.name }} hat keine direkt unterstellten Personen.
+{{ [person.job_title, person.department].filter(Boolean).join(' · ') }}
-Wer wem unterstellt ist – zum Aufklappen.
++ {{ number(stats.people) }} Personen · {{ number(stats.leaders) }} mit Personalverantwortung +
{{ unassigned === 1 ? '1 Person' : `${unassigned} Personen` }} ohne Vorgesetzte*n und ohne Team {{ unassigned === 1 ? 'erscheint' : 'erscheinen' }} hier nicht.
+ ++ {{ unassigned === 1 ? '1 Person' : `${number(unassigned)} Personen` }} ohne Vorgesetzte*n und ohne Team {{ unassigned === 1 ? 'erscheint' : 'erscheinen' }} hier nicht. +
diff --git a/tests/Feature/Documents/DocumentsTest.php b/tests/Feature/Documents/DocumentsTest.php index ca9f0399..6af8819d 100644 --- a/tests/Feature/Documents/DocumentsTest.php +++ b/tests/Feature/Documents/DocumentsTest.php @@ -127,6 +127,22 @@ class DocumentsTest extends TestCase } } + public function test_overview_lists_areas_and_recent_documents(): void + { + $this->personal->update(['description' => 'Alles rund ums Personal']); + $this->uploadTo($this->vertraege, [UploadedFile::fake()->create('Vertrag.pdf', 5)]); + + $this->get('/dokumente')->assertInertia(fn (Assert $p) => $p + ->where('children.0.description', 'Alles rund ums Personal') + ->where('children.0.folders', 1) + ->where('children.0.documents', 0) + ->where('recent.0.title', 'Vertrag') + ->where('recent.0.folder_name', 'Verträge') + ->where('recent.0.updated_by', $this->hr->name)); + + $this->get("/dokumente/ordner/{$this->vertraege->id}")->assertInertia(fn (Assert $p) => $p->where('recent', [])->where('documents.0.folder_name', null)); + } + public function test_folders_can_only_be_deleted_when_empty(): void { $this->actingAs($this->hr)->delete("/dokumente/ordner/{$this->vertraege->id}")->assertRedirect(route('documents.folder', $this->personal)); diff --git a/tests/Feature/OrganigramTest.php b/tests/Feature/OrganigramTest.php index e47c683b..b1252b30 100644 --- a/tests/Feature/OrganigramTest.php +++ b/tests/Feature/OrganigramTest.php @@ -40,6 +40,21 @@ class OrganigramTest extends TestCase ->where("teams.{$head->id}.0.id", $nurse->id)); } + public function test_focus_view_starts_at_the_top_and_shows_contact_details(): void + { + $ceo = User::factory()->create(['first_name' => 'Clara', 'last_name' => 'Chefin', 'phone' => '+49 40 1']); + $head = User::factory()->create(['manager_id' => $ceo->id]); + User::factory()->create(['manager_id' => $head->id]); + + $this->actingAs($head)->get('/personen/organigramm?ansicht=fokus')->assertInertia(fn (Assert $p) => $p + ->where('view', 'fokus') + ->where('focus', $ceo->id) + ->where('details.phone', '+49 40 1') + ->where('stats', ['people' => 3, 'leaders' => 2])); + + $this->get('/personen/organigramm?ansicht=unsinn')->assertInertia(fn (Assert $p) => $p->where('view', 'baum')->where('details', null)); + } + public function test_admin_sets_managers_without_cycles(): void { $this->actingAs(User::factory()->admin()->create());