withoutExceptionHandling()->login()->loginNami(); $member = Member::factory() ->defaults() ->has(Membership::factory()->in('€ LeiterIn', 5, 'Jungpfadfinder', 88)->state(['created_at' => '2022-11-19 05:00:00'])) ->has(Payment::factory()->notPaid()->nr('2019')->subscription('Free', 1050)) ->for(Gender::factory()->name('Männlich')) ->for(Region::factory()->name('NRW')) ->create([ 'birthday' => '1991-04-20', 'address' => 'Itterstr 3', 'zip' => '42719', 'location' => 'Solingen', 'firstname' => 'Max', 'lastname' => 'Muster', 'other_country' => 'other', 'main_phone' => '+49 212 1266775', 'mobile_phone' => '+49 212 1266776', 'work_phone' => '+49 212 1266777', 'children_phone' => '+49 212 1266778', 'email' => 'a@b.de', 'email_parents' => 'b@c.de', 'fax' => '+49 212 1255674', ]); $response = $this->get("/member/{$member->id}"); $this->assertInertiaHas([ 'birthday_human' => '20.04.1991', 'age' => 14, 'full_address' => 'Itterstr 3, 42719 Solingen', 'region' => ['name' => 'NRW'], 'other_country' => 'other', 'main_phone' => '+49 212 1266775', 'mobile_phone' => '+49 212 1266776', 'work_phone' => '+49 212 1266777', 'children_phone' => '+49 212 1266778', 'email' => 'a@b.de', 'email_parents' => 'b@c.de', 'fax' => '+49 212 1255674', 'fullname' => 'Herr Max Muster', ], $response, 'data'); $this->assertInertiaHas([ 'activity_name' => '€ LeiterIn', 'id' => $member->memberships->first()->id, 'human_date' => '19.11.2022', ], $response, 'data.memberships.0'); $this->assertInertiaHas([ 'subscription' => [ 'name' => 'Free', 'id' => $member->payments->first()->subscription->id, 'amount' => 1050, ], 'status_name' => 'Nicht bezahlt', 'nr' => '2019', ], $response, 'data.payments.0'); } public function testItShowsMinimalSingleMember(): void { $this->withoutExceptionHandling()->login()->loginNami(); $member = Member::factory() ->for(Group::factory()) ->for(Nationality::factory()->name('deutsch')) ->for(Subscription::factory()->for(Fee::factory())) ->create(['firstname' => 'Max', 'lastname' => 'Muster']); $response = $this->get("/member/{$member->id}"); $this->assertInertiaHas([ 'region' => ['name' => '-- kein --'], 'nationality' => ['name' => '-- kein --'], 'fullname' => 'Max Muster', 'nationality' => [ 'name' => 'deutsch', ], ], $response, 'data'); } }