Profilseite: Kommentare der Person
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m41s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m32s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m11s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m55s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m32s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 5m30s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m39s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m30s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m3s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 20:57:09 +00:00
parent 53df8918f6
commit 8a59023569
118 changed files with 620 additions and 438 deletions

View file

@ -92,4 +92,23 @@ class NewsCommentsTest extends TestCase
$this->assertSame(0, NewsComment::query()->count());
}
public function test_profile_lists_comments_on_visible_posts_only(): void
{
$anna = User::factory()->create();
$viewer = User::factory()->create(['department' => 'Werkstatt']);
$this->post->comments()->create(['user_id' => $anna->id, 'body' => 'Sichtbar für alle']);
$care = NewsCategory::query()->create(['name' => 'Pflege intern', 'slug' => 'pflege-intern']);
Audiences::sync('news_category', $care->id, ['department' => ['Pflege']]);
NewsPost::factory()->create(['category_id' => $care->id])->comments()->create(['user_id' => $anna->id, 'body' => 'Nur Pflege']);
$this->actingAs($viewer)->get("/personen/{$anna->id}")->assertInertia(fn (Assert $page) => $page
->where('panels.0.key', 'news.comments')
->where('panels.0.props.total', 1)
->where('panels.0.props.comments.0.excerpt', 'Sichtbar für alle')
->where('panels.0.props.comments.0.post.title', 'Sommerfest'));
// Ohne Kommentare kein Bereich
$this->actingAs($viewer)->get("/personen/{$viewer->id}")->assertInertia(fn (Assert $page) => $page->where('panels', []));
}
}