Profil zeigt geschriebene Beiträge, Als Person anmelden (0.27.1)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m40s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m51s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m1s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m45s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m36s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m21s
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 4m47s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m40s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 5m0s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m51s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m1s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m57s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 5m45s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 5m36s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m21s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
1469f50401
commit
546c94db1c
127 changed files with 643 additions and 337 deletions
|
|
@ -223,4 +223,22 @@ class NewsWorkflowTest extends TestCase
|
|||
$this->assertSame(['title' => 'MAV', 'count' => 3, 'layout' => 'cards', 'filter' => 'include', 'categories' => ['mav-info']], $items[0]['blocks'][0]['data']);
|
||||
$this->assertSame('all', $items[1]['blocks'][0]['data']['filter']);
|
||||
}
|
||||
|
||||
public function test_profile_lists_the_posts_a_person_has_written(): void
|
||||
{
|
||||
NewsPost::factory()->create(['author_id' => $this->author->id, 'category_id' => $this->company->id, 'title' => 'Neues Leitbild', 'published_at' => now()->subDay()]);
|
||||
NewsPost::factory()->draft()->create(['author_id' => $this->author->id, 'category_id' => $this->company->id, 'title' => 'Entwurf']);
|
||||
$viewer = User::factory()->create();
|
||||
|
||||
$this->actingAs($viewer)->get("/personen/{$this->author->id}")->assertInertia(fn ($page) => $page
|
||||
->where('panels', fn ($panels) => ($posts = collect($panels)->firstWhere('key', 'news.posts'))
|
||||
&& $posts['props']['total'] === 1 && $posts['props']['posts'][0]['title'] === 'Neues Leitbild'));
|
||||
|
||||
$this->get("/neuigkeiten?autor={$this->author->id}")->assertInertia(fn ($page) => $page
|
||||
->where('filter', 'Von: '.$this->author->name)
|
||||
->where('posts.data', fn ($posts) => collect($posts)->pluck('title')->all() === ['Neues Leitbild']));
|
||||
|
||||
// Ohne Beiträge kein Bereich
|
||||
$this->get("/personen/{$viewer->id}")->assertInertia(fn ($page) => $page->where('panels', fn ($panels) => ! collect($panels)->contains('key', 'news.posts')));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue