2023-02-14 14:27:11 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature\Activity;
|
|
|
|
|
|
|
|
use App\Activity;
|
|
|
|
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class IndexTest extends TestCase
|
|
|
|
{
|
|
|
|
use DatabaseTransactions;
|
|
|
|
|
|
|
|
public function testItDisplaysLocalActivities(): void
|
|
|
|
{
|
2023-02-14 14:32:34 +01:00
|
|
|
$this->login()->loginNami()->withoutExceptionHandling();
|
2023-02-14 14:27:11 +01:00
|
|
|
$local = Activity::factory()->name('Local')->create();
|
|
|
|
$remote = Activity::factory()->name('Remote')->inNami(123)->create();
|
|
|
|
|
|
|
|
$response = $this->get('/activity');
|
|
|
|
|
|
|
|
$this->assertInertiaHas('Local', $response, 'data.data.0.name');
|
|
|
|
$this->assertCount(1, $this->inertia($response, 'data.data'));
|
|
|
|
}
|
|
|
|
}
|