Add efz for members
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
philipp lang 2024-03-07 21:24:12 +01:00
parent b80b7ea600
commit a25d983de0
2 changed files with 3 additions and 4 deletions

View File

@ -156,7 +156,7 @@ class Member extends Model implements Geolocatable
public function getEfzLink(): ?string
{
return $this->isLeader() && $this->address && $this->zip && $this->location && $this->birthday
return $this->address && $this->zip && $this->location && $this->birthday
? route('efz', ['member' => $this])
: null;
}

View File

@ -84,7 +84,7 @@ class IndexTest extends TestCase
->defaults()
->has(Membership::factory()->in('€ Mitglied', 456, 'Pfadfinder', 16))
->create(['lastname' => 'B']);
Member::factory()
$emptyMember = Member::factory()
->defaults()
->create(['lastname' => 'C']);
@ -92,8 +92,7 @@ class IndexTest extends TestCase
$response = $this->get('/member');
$this->assertInertiaHas(url("/member/{$member->id}/efz"), $response, 'data.data.0.efz_link');
$this->assertInertiaHas(null, $response, 'data.data.1.efz_link');
$this->assertInertiaHas(null, $response, 'data.data.2.efz_link');
$this->assertInertiaHas(url("/member/{$emptyMember->id}/efz"), $response, 'data.data.2.efz_link');
$this->assertInertiaHas(true, $response, 'data.data.0.is_leader');
$this->assertInertiaHas(false, $response, 'data.data.1.is_leader');
$this->assertInertiaHas(false, $response, 'data.data.2.is_leader');