Files
pricebuddy/tests/Feature/Filament/NotificationsUserMenuTest.php
JeremyandClaude Opus 4.8 0c21d7389c feat: move notifications from sidebar to user menu
Hide the Notifications resource from the sidebar navigation and surface it
as a user-menu item (avatar dropdown) instead, linking to the same page.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 10:14:52 +10:00

37 lines
1.1 KiB
PHP

<?php
namespace Tests\Feature\Filament;
use App\Filament\Resources\NotificationHistoryResource;
use App\Models\User;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class NotificationsUserMenuTest extends TestCase
{
use RefreshDatabase;
protected function setUp(): void
{
parent::setUp();
$this->actingAs(User::factory()->create());
Filament::setCurrentPanel(Filament::getPanel('admin'));
}
public function test_notifications_is_not_registered_in_the_sidebar_navigation()
{
$this->assertFalse(NotificationHistoryResource::shouldRegisterNavigation());
}
public function test_notifications_is_available_in_the_user_menu()
{
$items = collect(Filament::getCurrentPanel()->getUserMenuItems());
$notifications = $items->first(fn ($item) => $item->getLabel() === 'Notifications');
$this->assertNotNull($notifications, 'Notifications should be in the user menu.');
$this->assertSame(NotificationHistoryResource::getUrl('index'), $notifications->getUrl());
}
}