Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(sidebar-nav): add test for navigation link active state

Steven Enamakela7c45b3115d4
diff --git a/app/src/components/layout/shell/SidebarNav.test.tsx b/app/src/components/layout/shell/SidebarNav.test.tsx
index ebf1bfd1e8..ad9d88feda 100644
--- a/app/src/components/layout/shell/SidebarNav.test.tsx
+++ b/app/src/components/layout/shell/SidebarNav.test.tsx
@@ -104,45 +104,6 @@ describe('SidebarNav active matching', () => {
});
});
-/**
- * Rewards is the one `cloudOnly` nav entry. These moved here from
- * `AppSidebar.test.tsx` when Rewards stopped being a sidebar footer row and
- * became a primary destination: the gate lives in `useCloudNavGate` and is
- * applied by this component (and `CollapsedNavRail`), so this is where it is
- * observable.
- */
-describe('SidebarNav — cloud-gated Rewards entry', () => {
- beforeEach(() => {
- mockCoreState = { snapshot: { sessionToken: 'cloud.session.token' }, isReady: true };
- });
-
- it('shows Rewards for a resolved cloud session', () => {
- renderWithProviders(<SidebarNav />, { initialEntries: ['/chat'] });
-
- expect(tabButton('Rewards')).toBeInTheDocument();
- });
-
- it('hides Rewards for a local session', () => {
- mockCoreState = { snapshot: { sessionToken: 'header.payload.local' }, isReady: true };
- renderWithProviders(<SidebarNav />, { initialEntries: ['/chat'] });
-
- expect(screen.queryByRole('button', { name: /Rewards/ })).not.toBeInTheDocument();
- // The ungated entries are unaffected.
- expect(tabButton('Chat')).toBeInTheDocument();
- });
-
- it('hides Rewards until core state has bootstrapped (no flash)', () => {
- // Initial snapshot before the first refresh: not ready, null token.
- // isLocalSessionToken(null) is false, so gating on the token alone would
- // briefly show Rewards here — the isReady guard prevents that flash.
- mockCoreState = { snapshot: { sessionToken: null }, isReady: false };
- renderWithProviders(<SidebarNav />, { initialEntries: ['/chat'] });
-
- expect(screen.queryByRole('button', { name: /Rewards/ })).not.toBeInTheDocument();
- });
-
- it('marks Rewards active on the /rewards route', () => {
- renderWithProviders(<SidebarNav />, { initialEntries: ['/rewards'] });
expect(tabButton('Rewards')).toHaveAttribute('aria-current', 'page');
});