Compare commits

..

No commits in common. "5b0bb1c81c29544062e0ecaf361bf8b955fe62b5" and "9788ce8fe6364b891398d89ab5f95f0723ba79f3" have entirely different histories.

1 changed files with 12 additions and 12 deletions

View File

@ -26,10 +26,10 @@ class MemberIndexTest extends TestCase
public function testItHandlesFullTextSearch(): void public function testItHandlesFullTextSearch(): void
{ {
$this->withoutExceptionHandling()->login()->loginNami(); $this->withoutExceptionHandling()->login()->loginNami();
Member::factory()->defaults()->create(['firstname' => 'Alexander']); $group = Group::factory()->create();
Member::factory()->defaults()->create(['firstname' => 'Heinrich']); Member::factory()->defaults()->for($group)->create(['firstname' => 'Alexander']);
Member::factory()->defaults()->for($group)->create(['firstname' => 'Heinrich']);
sleep(5);
$response = $this->callFilter('member.index', ['search' => 'Alexander']); $response = $this->callFilter('member.index', ['search' => 'Alexander']);
$this->assertCount(1, $this->inertia($response, 'data.data')); $this->assertCount(1, $this->inertia($response, 'data.data'));
@ -38,11 +38,11 @@ class MemberIndexTest extends TestCase
public function testItHandlesAddress(): void public function testItHandlesAddress(): void
{ {
$this->withoutExceptionHandling()->login()->loginNami(); $this->withoutExceptionHandling()->login()->loginNami();
Member::factory()->defaults()->create(['address' => '']); $group = Group::factory()->create();
Member::factory()->defaults()->create(['zip' => '']); Member::factory()->defaults()->for($group)->create(['address' => '']);
Member::factory()->defaults()->create(['location' => '']); Member::factory()->defaults()->for($group)->create(['zip' => '']);
Member::factory()->defaults()->for($group)->create(['location' => '']);
sleep(5);
$response = $this->callFilter('member.index', ['has_full_address' => true]); $response = $this->callFilter('member.index', ['has_full_address' => true]);
$noResponse = $this->callFilter('member.index', ['has_full_address' => false]); $noResponse = $this->callFilter('member.index', ['has_full_address' => false]);
@ -53,9 +53,9 @@ class MemberIndexTest extends TestCase
public function testItHandlesBirthday(): void public function testItHandlesBirthday(): void
{ {
$this->withoutExceptionHandling()->login()->loginNami(); $this->withoutExceptionHandling()->login()->loginNami();
$member = Member::factory()->defaults()->create(['birthday' => null]); $group = Group::factory()->create();
$member = Member::factory()->defaults()->for(Group::factory())->create(['birthday' => null]);
sleep(5);
$response = $this->callFilter('member.index', ['has_birthday' => true]); $response = $this->callFilter('member.index', ['has_birthday' => true]);
$this->assertCount(0, $this->inertia($response, 'data.data')); $this->assertCount(0, $this->inertia($response, 'data.data'));
@ -65,12 +65,12 @@ class MemberIndexTest extends TestCase
public function testItFiltersForSearchButNotForPayments(): void public function testItFiltersForSearchButNotForPayments(): void
{ {
$this->withoutExceptionHandling()->login()->loginNami(); $this->withoutExceptionHandling()->login()->loginNami();
Member::factory()->defaults() $group = Group::factory()->create();
Member::factory()->defaults()->for($group)
->has(InvoicePosition::factory()->for(Invoice::factory())) ->has(InvoicePosition::factory()->for(Invoice::factory()))
->create(['firstname' => '::firstname::']); ->create(['firstname' => '::firstname::']);
Member::factory()->defaults()->create(['firstname' => '::firstname::']); Member::factory()->defaults()->for($group)->create(['firstname' => '::firstname::']);
sleep(5);
$response = $this->callFilter('member.index', ['search' => '::firstname::', 'ausstand' => true]); $response = $this->callFilter('member.index', ['search' => '::firstname::', 'ausstand' => true]);
$this->assertCount(1, $this->inertia($response, 'data.data')); $this->assertCount(1, $this->inertia($response, 'data.data'));