fix: correct dark branding and tenant logo rendering

This commit is contained in:
MeghdadFadaee committed 2026-09-09 20:54:39 +03:30
1 parent 1d3aa42b6c
commit f62103d44b
10 files changed
+73 -28

No files matched your search

+17
View File
@@ -3,6 +3,7 @@
use Illuminate\Support\Facades\Event;
use MeghdadFadaee\NovaTenancy\Events\TenantCleared;
use MeghdadFadaee\NovaTenancy\Events\TenantSelected;
use MeghdadFadaee\NovaTenancy\NovaTenancy;
use MeghdadFadaee\NovaTenancy\Tests\Fixtures\Tenant;
use MeghdadFadaee\NovaTenancy\Tests\Fixtures\User;
@@ -89,3 +90,19 @@ it('renders a fallback for unsafe logo schemes', function (): void {
->assertOk()
->assertHeader('Content-Type', 'image/svg+xml; charset=UTF-8');
});
it('falls through when a custom logo response returns null', function (): void {
$user = User::query()->create(['name' => 'Ada']);
$tenant = Tenant::query()->create([
'user_id' => $user->id,
'title' => 'Alpha',
'logo_url' => 'https://cdn.example.com/alpha.png',
]);
NovaTenancy::logoResponseUsing(fn () => null);
$this->actingAs($user)
->withCookie('nova_tenant', (string) $tenant->id)
->get('/testing/current/logo')
->assertRedirect('https://cdn.example.com/alpha.png');
});