mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-02-15 03:23:17 +00:00
Die News Ansicht verschönern (vibe-kanban 7c9cbf57)
Nutze Livewire Flux UI um die Ansicht der News Items zu verschönern. Teste alles am besten auch eine Validierung mit playwright, ob alles passt und richtig in mobile und Desktop angezeigt wird.
This commit is contained in:
@@ -112,3 +112,103 @@ it('displays news list', function () {
|
||||
->assertSee($news1->name)
|
||||
->assertSee($news2->name);
|
||||
});
|
||||
|
||||
it('shows warning callout when access is denied', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->create([
|
||||
'association_status' => AssociationStatus::PASSIVE,
|
||||
]);
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSet('isAllowed', false)
|
||||
->assertSee('Zugriff auf News nicht möglich')
|
||||
->assertSee('Aktives Mitglied');
|
||||
});
|
||||
|
||||
it('shows nostr login hint when not authenticated', function () {
|
||||
Livewire::test('association.news')
|
||||
->assertSet('isAllowed', false)
|
||||
->assertSee('Bitte melde dich zunächst mit Nostr an');
|
||||
});
|
||||
|
||||
it('displays category badges as filters', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSee('Alle')
|
||||
->assertSee('Einundzwanzig')
|
||||
->assertSee('Allgemeines')
|
||||
->assertSee('Organisation');
|
||||
});
|
||||
|
||||
it('filters news by category', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
$newsOrg = Notification::factory()->create(['category' => NewsCategory::Organisation]);
|
||||
$newsBtc = Notification::factory()->create(['category' => NewsCategory::Bitcoin]);
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSee($newsOrg->name)
|
||||
->assertSee($newsBtc->name)
|
||||
->call('filterByCategory', NewsCategory::Organisation->value)
|
||||
->assertSee($newsOrg->name)
|
||||
->assertDontSee($newsBtc->name);
|
||||
});
|
||||
|
||||
it('shows empty state when no news exist', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSee('Noch keine News vorhanden');
|
||||
});
|
||||
|
||||
it('shows filtered empty state with clear button', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->call('filterByCategory', NewsCategory::Bildung->value)
|
||||
->assertSee('Keine News in dieser Kategorie')
|
||||
->assertSee('Alle anzeigen');
|
||||
});
|
||||
|
||||
it('displays news card with author name and date', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
$news = Notification::factory()->create([
|
||||
'name' => 'Wichtige Neuigkeiten',
|
||||
'description' => 'Hier steht die Beschreibung',
|
||||
]);
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSee('Wichtige Neuigkeiten')
|
||||
->assertSee('Hier steht die Beschreibung')
|
||||
->assertSee($news->created_at->format('d.m.Y'));
|
||||
});
|
||||
|
||||
it('shows create form only for board members', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->active()->withPaidCurrentYear()->create();
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertDontSee('News anlegen');
|
||||
});
|
||||
|
||||
it('displays create form for board members', function () {
|
||||
$pleb = EinundzwanzigPleb::factory()->boardMember()->withPaidCurrentYear()->create();
|
||||
|
||||
NostrAuth::login($pleb->pubkey);
|
||||
|
||||
Livewire::test('association.news')
|
||||
->assertSee('News anlegen')
|
||||
->assertSee('Hinzufügen');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user