display also nami activities
continuous-integration/drone/push Build is passing Details

This commit is contained in:
philipp lang 2023-03-04 23:47:42 +01:00
parent d776a66836
commit 241b46da53
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class IndexAction
public function handle(ActivityFilterScope $filter): AnonymousResourceCollection 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 public function asController(ActionRequest $request): Response
@ -30,7 +30,7 @@ class IndexAction
'data' => $this->handle($filter), 'data' => $this->handle($filter),
'toolbar' => [ 'toolbar' => [
['href' => route('activity.create'), 'label' => 'Tätigkeit erstellen', 'color' => 'primary', 'icon' => 'plus'], ['href' => route('activity.create'), 'label' => 'Tätigkeit erstellen', 'color' => 'primary', 'icon' => 'plus'],
] ],
]); ]);
} }
} }

View File

@ -11,7 +11,7 @@ class IndexTest extends TestCase
{ {
use DatabaseTransactions; use DatabaseTransactions;
public function testItDisplaysLocalActivities(): void public function testItDisplaysActivities(): void
{ {
$this->login()->loginNami()->withoutExceptionHandling(); $this->login()->loginNami()->withoutExceptionHandling();
$first = Activity::factory()->name('Local')->create(); $first = Activity::factory()->name('Local')->create();
@ -22,7 +22,7 @@ class IndexTest extends TestCase
$this->assertInertiaHas('Local', $response, 'data.data.0.name'); $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.update', ['activity' => $first]), $response, 'data.data.0.links.update');
$this->assertInertiaHas(route('activity.destroy', ['activity' => $first]), $response, 'data.data.0.links.destroy'); $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 public function testItDisplaysDefaultFilter(): void