Files
einundzwanzig-verein/tests/Feature/Livewire/Association/BenefitsTest.php
T
HolgerHatGarKeineNode d242933410 🛠️ Update dependencies in composer.lock to latest versions
- Upgraded multiple packages, including `brick/math`, `guzzlehttp/guzzle`, `laravel/framework`, `spatie/image`, and more.
- Ensured compatibility with project requirements by verifying dependency interrelations.
2026-06-22 16:00:36 +02:00

48 lines
1.3 KiB
PHP

<?php
use App\Models\EinundzwanzigPleb;
use App\Support\NostrAuth;
use Livewire\Livewire;
function activePaidPleb(): EinundzwanzigPleb
{
$pleb = EinundzwanzigPleb::factory()->active()->create();
$pleb->paymentEvents()->create([
'year' => date('Y'),
'amount' => 21000,
'event_id' => 'event-benefits',
'paid' => true,
]);
return $pleb;
}
it('shows the locked state with all four services for guests', function () {
Livewire::test('association.benefits')
->assertSet('currentYearIsPaid', false)
->assertSee('Dienste gesperrt')
->assertSee('Blossom-Medienserver')
->assertDontSee('https://blossom.einundzwanzig.space');
});
it('unlocks the blossom server for active paid members', function () {
$pleb = activePaidPleb();
NostrAuth::login($pleb->pubkey);
Livewire::test('association.benefits')
->assertSet('currentYearIsPaid', true)
->assertSee('Mitgliedschaft aktiv')
->assertSee('Blossom Medienserver')
->assertSee('https://blossom.einundzwanzig.space');
});
it('copies the blossom url for active members', function () {
$pleb = activePaidPleb();
NostrAuth::login($pleb->pubkey);
Livewire::test('association.benefits')
->call('copyBlossomUrl')
->assertHasNoErrors();
});