🚀 Refactor: Centralize isBoardMember logic in EinundzwanzigPleb model and replace redundant checks

This commit is contained in:
HolgerHatGarKeineNode
2026-05-18 22:04:45 +02:00
parent cb61d9d543
commit 3b855e9517
14 changed files with 86 additions and 75 deletions
@@ -54,6 +54,18 @@ it('allows board member to edit news', function () {
->assertSet('canEdit', true);
});
it('grants board member access even without active membership or paid year', function () {
$pleb = EinundzwanzigPleb::factory()->boardMember()->create([
'association_status' => AssociationStatus::DEFAULT,
]);
NostrAuth::login($pleb->pubkey);
Livewire::test('association.news')
->assertSet('isAllowed', true)
->assertSet('canEdit', true);
});
it('can create news entry with pdf', function () {
$pleb = EinundzwanzigPleb::factory()->boardMember()->withPaidCurrentYear()->create();