From 241b46da53f27f595ae68e5d759eddfae4792c34 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Sat, 4 Mar 2023 23:47:42 +0100 Subject: [PATCH] display also nami activities --- app/Activity/Actions/IndexAction.php | 4 ++-- tests/Feature/Activity/IndexTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Activity/Actions/IndexAction.php b/app/Activity/Actions/IndexAction.php index 752dbe16..58c98ff3 100644 --- a/app/Activity/Actions/IndexAction.php +++ b/app/Activity/Actions/IndexAction.php @@ -17,7 +17,7 @@ class IndexAction public function handle(ActivityFilterScope $filter): AnonymousResourceCollection { - return ActivityResource::collection(Activity::local()->withFilter($filter)->paginate(20)); + return ActivityResource::collection(Activity::withFilter($filter)->paginate(20)); } public function asController(ActionRequest $request): Response @@ -30,7 +30,7 @@ class IndexAction 'data' => $this->handle($filter), 'toolbar' => [ ['href' => route('activity.create'), 'label' => 'Tätigkeit erstellen', 'color' => 'primary', 'icon' => 'plus'], - ] + ], ]); } } diff --git a/tests/Feature/Activity/IndexTest.php b/tests/Feature/Activity/IndexTest.php index 14ba7207..da2e8b60 100644 --- a/tests/Feature/Activity/IndexTest.php +++ b/tests/Feature/Activity/IndexTest.php @@ -11,7 +11,7 @@ class IndexTest extends TestCase { use DatabaseTransactions; - public function testItDisplaysLocalActivities(): void + public function testItDisplaysActivities(): void { $this->login()->loginNami()->withoutExceptionHandling(); $first = Activity::factory()->name('Local')->create(); @@ -22,7 +22,7 @@ class IndexTest extends TestCase $this->assertInertiaHas('Local', $response, 'data.data.0.name'); $this->assertInertiaHas(route('activity.update', ['activity' => $first]), $response, 'data.data.0.links.update'); $this->assertInertiaHas(route('activity.destroy', ['activity' => $first]), $response, 'data.data.0.links.destroy'); - $this->assertCount(1, $this->inertia($response, 'data.data')); + $this->assertCount(2, $this->inertia($response, 'data.data')); } public function testItDisplaysDefaultFilter(): void