--wip-- [skip ci]
This commit is contained in:
parent
ba3e88b930
commit
20dea4502c
|
@ -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
|
|||
|
||||
<x-ui::box class="relative col-span-2" title="Mitglieder finden">
|
||||
<x-ui::errors for="members" />
|
||||
<x-form::text name="search_text" id="search_input" wire:model.live="search" class="col-span-2" label="Suchen …" size="sm" wire:keydown.enter="onSubmitFirstMemberResult"></x-form::text>
|
||||
<x-form::text name="search_text" id="search_input" wire:model.live="search" class="col-span-2" label="Suchen …" size="sm" wire:keydown.enter.prevent="onSubmitFirstMemberResult"></x-form::text>
|
||||
<div class="mt-2 grid grid-cols-[repeat(auto-fill,minmax(180px,1fr))] gap-2 col-span-2">
|
||||
@foreach($memberResults as $member)
|
||||
<x-form::lever
|
||||
|
@ -117,7 +117,7 @@ class FillList extends Component
|
|||
name="members"
|
||||
:value="$member->id"
|
||||
size="sm"
|
||||
wire:keydown.enter="onSubmitMemberResult({{$member->id}})"
|
||||
wire:keydown.enter.prevent="onSubmitMemberResult({{$member->id}})"
|
||||
></x-form::lever>
|
||||
@endforeach
|
||||
</div>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Feature\Contribution;
|
||||
|
||||
use App\Contribution\Documents\RdpNrwDocument;
|
||||
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();
|
||||
$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');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue