🔒 Fix conditional checks in Livewire Profile to prevent null errors for users without association records

- Updated Blade conditionals to verify `$currentPleb` exists before accessing its properties.
- Added test case to ensure `Profile` renders correctly for logged-in pubkeys without associated pleb records.
This commit is contained in:
HolgerHatGarKeineNode
2026-06-17 10:02:14 +02:00
parent 5f28bfedd4
commit d07d2b3fba
2 changed files with 11 additions and 2 deletions
@@ -60,6 +60,15 @@ it('clears state on nostr logout', function () {
->assertSet('currentPleb', null);
});
it('renders without error for a logged-in pubkey that has no pleb record', function () {
NostrAuth::login(str_repeat('a', 64));
Livewire::test('association.profile')
->assertSet('currentPubkey', str_repeat('a', 64))
->assertSet('currentPleb', null)
->assertStatus(200);
});
it('can save email address', function () {
$pleb = EinundzwanzigPleb::factory()->create();