adrema/tests/Feature/Membership/AgeGroupCountBlockTest.php

44 lines
1.4 KiB
PHP
Raw Normal View History

2022-11-17 02:15:29 +01:00
<?php
namespace Tests\Feature\Membership;
use App\Member\Member;
use App\Member\Membership;
use Illuminate\Foundation\Testing\DatabaseTransactions;
2024-10-13 21:00:47 +02:00
use Livewire\Livewire;
use Modules\Member\AgeGroupCountBlock;
2022-11-17 02:15:29 +01:00
use Tests\TestCase;
class AgeGroupCountBlockTest extends TestCase
{
use DatabaseTransactions;
public function testItDisplaysAgeGroups(): void
{
$this->withoutExceptionHandling();
Member::factory()->count(3)
->has(Membership::factory()->in('€ Mitglied', 1, 'Biber', 2))
->defaults()
->create();
Member::factory()->count(4)
->has(Membership::factory()->in('€ Mitglied', 1, 'Wölfling', 3))
->defaults()
->create();
2022-12-13 21:13:51 +01:00
Member::factory()->count(2)->has(Membership::factory()->in('€ LeiterIn', 2, 'Wölfling', 3))
->defaults()
->create();
2023-02-23 01:20:51 +01:00
Member::factory()->count(2)
->has(Membership::factory()->in('€ LeiterIn', 2, 'Jungpfadfinder', 3))
->has(Membership::factory()->ended()->in('€ LeiterIn', 2, 'Pfadfinder', 3))
->has(Membership::factory()->ended()->in('€ Mitglied', 2, 'Jungpfadfinder', 3))
2022-11-17 02:15:29 +01:00
->defaults()
->create();
2024-10-13 21:00:47 +02:00
Livewire::test(AgeGroupCountBlock::class)
->assertSee('Biber')
->assertSee('Wölfling')
->assertSee('Leiter')
->assertSeeInOrder([3, 4, 4]);
2022-11-17 02:15:29 +01:00
}
}