mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-06-17 17:00:31 +00:00
🔒 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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user