adrema/tests/Feature/Contribution/IndexTest.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2022-11-17 21:47:45 +01:00
<?php
namespace Tests\Feature\Contribution;
2023-09-07 12:04:13 +02:00
use App\Contribution\Documents\RdpNrwDocument;
2022-11-17 21:47:45 +01:00
use App\Country;
use App\Member\Member;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Tests\TestCase;
class IndexTest extends TestCase
{
use DatabaseTransactions;
public function testItHasContributionIndex(): void
{
$this->withoutExceptionHandling()->login()->loginNami();
2023-02-26 20:51:59 +01:00
$country = Country::factory()->create(['name' => 'Deutschland']);
Member::factory()->defaults()->create(['firstname' => 'Max', 'lastname' => 'Muster']);
Member::factory()->defaults()->create(['firstname' => 'Jane', 'lastname' => 'Muster']);
2022-11-17 21:47:45 +01:00
$response = $this->get('/contribution');
$this->assertInertiaHas([
2023-09-07 12:04:13 +02:00
'class' => RdpNrwDocument::class,
2023-09-07 13:12:47 +02:00
'title' => 'Für RdP NRW erstellen',
2022-11-17 21:47:45 +01:00
], $response, 'compilers.0');
2023-02-26 20:51:59 +01:00
$this->assertInertiaHas([
'id' => $country->id,
'name' => $country->name,
], $response, 'countries.0');
$this->assertInertiaHas([
'country' => $country->id,
], $response, 'data');
2022-11-17 21:47:45 +01:00
}
}