From 16c5ab294a5cbcb63dd867229490f3b89fbb19b7 Mon Sep 17 00:00:00 2001 From: philipp lang Date: Thu, 3 Apr 2025 21:49:42 +0200 Subject: [PATCH] --wip-- [skip ci] --- modules/Contribution/Components/FillList.php | 6 ++-- .../Contribution/Components/FillListTest.php | 6 +++- tests/Feature/Contribution/IndexTest.php | 36 ------------------- 3 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 tests/Feature/Contribution/IndexTest.php diff --git a/modules/Contribution/Components/FillList.php b/modules/Contribution/Components/FillList.php index 35ce6cea..7f230091 100644 --- a/modules/Contribution/Components/FillList.php +++ b/modules/Contribution/Components/FillList.php @@ -24,7 +24,7 @@ class FillList extends Component #[Validate(rule: 'array|min:1', as: 'Mitglieder')] public $members = []; #[Validate(rule: 'required', as: 'Formular')] - public string $compiler; + public ?string $compiler = null; #[Validate(rule: 'required', as: 'PLZ / Ort')] public string $zipLocation; @@ -106,7 +106,7 @@ class FillList extends Component - +
@foreach($memberResults as $member) @endforeach
diff --git a/modules/Contribution/Components/FillListTest.php b/modules/Contribution/Components/FillListTest.php index df206d17..ed1c29df 100644 --- a/modules/Contribution/Components/FillListTest.php +++ b/modules/Contribution/Components/FillListTest.php @@ -2,6 +2,7 @@ namespace Modules\Contribution\Components; +use App\Country; use Tests\TestCase; use Illuminate\Foundation\Testing\DatabaseTransactions; use Livewire\Livewire; @@ -19,8 +20,11 @@ it('displays page', function () { }); it('loads component', function () { + $country = Country::factory()->create(); Livewire::test(FillList::class) - ->assertSee('Zuschüsse'); + ->assertSee('Zuschüsse') + ->assertSee($country->name) + ->assertSee('RdP NRW'); }); it('validates payload', function (array $attributes, array $error) { diff --git a/tests/Feature/Contribution/IndexTest.php b/tests/Feature/Contribution/IndexTest.php deleted file mode 100644 index f9bd9ec5..00000000 --- a/tests/Feature/Contribution/IndexTest.php +++ /dev/null @@ -1,36 +0,0 @@ -withoutExceptionHandling()->login()->loginNami(); - $country = Country::factory()->create(['name' => 'Deutschland']); - Member::factory()->defaults()->create(['firstname' => 'Max', 'lastname' => 'Muster']); - Member::factory()->defaults()->create(['firstname' => 'Jane', 'lastname' => 'Muster']); - - $response = $this->get('/contribution'); - - $this->assertInertiaHas([ - 'class' => RdpNrwDocument::class, - 'title' => 'Für RdP NRW erstellen', - ], $response, 'compilers.0'); - $this->assertInertiaHas([ - 'id' => $country->id, - 'name' => $country->name, - ], $response, 'countries.0'); - $this->assertInertiaHas([ - 'country' => $country->id, - ], $response, 'data'); - } -}