Skip to content

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

fix(sidebar): remove unused test file

Steven Enamakelefd1ba2f416a
diff --git a/app/src/components/layout/shell/AppSidebar.test.tsx b/app/src/components/layout/shell/AppSidebar.test.tsx
index deaa8199fc..f127b32f92 100644
--- a/app/src/components/layout/shell/AppSidebar.test.tsx
+++ b/app/src/components/layout/shell/AppSidebar.test.tsx
@@ -104,3 +104,37 @@ describe('AppSidebar — Rewards footer entry', () => {
expect(screen.getByTitle('nav.rewards')).toHaveAttribute('aria-current', 'page');
});
});
+
+// The `Sidebar` column stays mounted while collapsed (`collapsible="icon"`),
+// so `AppSidebar` — not `RootShellLayout` — is what switches to the compact
+// rail body. These render inside a collapsed `SidebarProvider` directly,
+// bypassing the mocked SidebarHeader/SidebarNav above so the real collapsed
+// branch (drag strip, reopen trigger, CollapsedNavRail) is under test.
+describe('AppSidebar — collapsed rail', () => {
+ beforeEach(() => vi.clearAllMocks());
+
+ it('renders the reopen trigger and collapsed nav rail instead of the header/nav', () => {
+ renderAppSidebar({ initialEntries: ['/chat'] }, { open: false });
+
+ expect(screen.getByTestId('root-shell-reopen')).toBeInTheDocument();
+ // The primary nav destinations still resolve via CollapsedNavRail.
+ expect(screen.getByRole('button', { name: 'nav.chat' })).toBeInTheDocument();
+ });
+
+ it('reserves a draggable strip above the reopen trigger for the macOS traffic lights', () => {
+ const { container } = renderAppSidebar({ initialEntries: ['/chat'] }, { open: false });
+ expect(container.querySelector('[data-tauri-drag-region]')).toBeInTheDocument();
+ });
+
+ it('gives the reopen trigger the expected analytics id and label', () => {
+ renderAppSidebar({ initialEntries: ['/chat'] }, { open: false });
+ const reopen = screen.getByTestId('root-shell-reopen');
+ expect(reopen).toHaveAttribute('data-analytics-id', 'root-shell-reopen-sidebar');
+ expect(reopen).toHaveAttribute('aria-label', 'layout.showSidebar');
+ });
+
+ it('does not render the reopen trigger while expanded', () => {
+ renderAppSidebar({ initialEntries: ['/chat'] }, { open: true });
+ expect(screen.queryByTestId('root-shell-reopen')).not.toBeInTheDocument();
+ });
+});