Skip to content

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

test: remove unused test files for AppearancePanel and Brain page

Steven Enamakelb68e9b10caf3
diff --git a/app/src/components/settings/panels/AppearancePanel.test.tsx b/app/src/components/settings/panels/AppearancePanel.test.tsx
index 7a7acf4743..01d23872a1 100644
--- a/app/src/components/settings/panels/AppearancePanel.test.tsx
+++ b/app/src/components/settings/panels/AppearancePanel.test.tsx
@@ -40,10 +40,24 @@ describe('<AppearancePanel />', () => {
expect(queryByTestId('theme-customize')).not.toBeInTheDocument();
});
- it('redirects away (renders no font-size card) for the legacy #studio hash', () => {
- const { queryByTestId } = renderPanel('medium', null, ['/settings/appearance#studio']);
- // AppearancePanel returns <Navigate to="/settings/theme" replace /> for this
- // hash instead of its own body.
+ it('redirects to /settings/theme for the legacy #studio hash', () => {
+ // A real `<Routes>` switches AppearancePanel out for whatever matches
+ // /settings/theme, so verify the redirect the way the app actually
+ // renders it rather than inspecting the pre-navigation render.
+ const store = createTestStore({
+ theme: { mode: 'system', tabBarLabels: 'hover', fontSize: 'medium', customFontSizePx: null },
+ });
+ const { getByTestId, queryByTestId } = render(
+ <Provider store={store}>
+ <MemoryRouter initialEntries={['/settings/appearance#studio']}>
+ <Routes>
+ <Route path="/settings/appearance" element={<AppearancePanel />} />
+ <Route path="/settings/theme" element={<div data-testid="theme-route" />} />
+ </Routes>
+ </MemoryRouter>
+ </Provider>
+ );
+ expect(getByTestId('theme-route')).toBeInTheDocument();
expect(queryByTestId('font-size-card')).not.toBeInTheDocument();
});
});
diff --git a/app/src/pages/__tests__/Brain.test.tsx b/app/src/pages/__tests__/Brain.test.tsx
index b7d1ca8ffe..2e1a88e63d 100644
--- a/app/src/pages/__tests__/Brain.test.tsx
+++ b/app/src/pages/__tests__/Brain.test.tsx
@@ -159,16 +159,33 @@ describe('Brain page', () => {
});
});
- it('shows the sync history panel on the Sync tab', async () => {
+ // Sync has two sub-views reflected in `?view=`: the default "status" view
+ // (live status panel + activity card) and "history" (the full-height run
+ // history table). They're mutually exclusive panes, not stacked together.
+ it('shows the live status and activity panels on the Sync status sub-view (default)', async () => {
graphExportMock.mockResolvedValue(makeGraph(0));
await act(async () => {
renderWithProviders(<Brain />, { initialEntries: ['/?tab=sync'] });
});
await waitFor(() => {
- expect(screen.getByTestId('brain-sync-history')).toBeInTheDocument();
- expect(screen.getByTestId('brain-sync-audit')).toBeInTheDocument();
+ expect(screen.getByTestId('brain-sync')).toBeInTheDocument();
expect(screen.getByTestId('brain-sync-activity')).toBeInTheDocument();
expect(screen.getByTestId('brain-sync-activity-card')).toBeInTheDocument();
});
+ expect(screen.queryByTestId('brain-sync-history')).toBeNull();
+ expect(screen.queryByTestId('brain-sync-audit')).toBeNull();
+ });
+
+ it('shows the sync history panel on the Sync history sub-view', async () => {
+ graphExportMock.mockResolvedValue(makeGraph(0));
+ await act(async () => {
+ renderWithProviders(<Brain />, { initialEntries: ['/?tab=sync&view=history'] });
+ });
+ await waitFor(() => {
+ expect(screen.getByTestId('brain-sync-history')).toBeInTheDocument();
+ expect(screen.getByTestId('brain-sync-audit')).toBeInTheDocument();
+ });
+ expect(screen.queryByTestId('brain-sync-activity')).toBeNull();
+ expect(screen.queryByTestId('brain-sync-activity-card')).toBeNull();
});
});