Skip to content

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

fix(routing): correct BrainRedirect test to expect redirect on missing brain

Steven Enamakel03cb90fdc7be
diff --git a/app/src/components/routing/BrainRedirect.test.tsx b/app/src/components/routing/BrainRedirect.test.tsx
index fdb86e8f08..cb6209fe59 100644
--- a/app/src/components/routing/BrainRedirect.test.tsx
+++ b/app/src/components/routing/BrainRedirect.test.tsx
@@ -22,17 +22,31 @@ function renderAt(entry: string) {
}
describe('BrainRedirect', () => {
- it('lands bare /brain on the Brain tab of Connections', () => {
+ it('lands bare /brain on the Memory tab of Connections', () => {
expect(renderAt('/brain')).toBe('/connections?tab=brain');
});
- it('moves the old ?tab= sub-tab to ?brain=', () => {
- expect(renderAt('/brain?tab=sources')).toBe('/connections?tab=brain&brain=sources');
+ it('maps the v1 graph and goals sub-tabs to the ask chip', () => {
+ expect(renderAt('/brain?tab=graph')).toBe('/connections?tab=brain&brain=ask');
+ expect(renderAt('/brain?tab=goals')).toBe('/connections?tab=brain&brain=ask');
});
- it('keeps other params and the hash', () => {
- expect(renderAt('/brain?tab=sync&view=history#x')).toBe(
- '/connections?tab=brain&brain=sync&view=history#x'
+ it('maps the v1 sources and sync sub-tabs to the documents chip', () => {
+ expect(renderAt('/brain?tab=sources')).toBe('/connections?tab=brain&brain=documents');
+ expect(renderAt('/brain?tab=sync')).toBe('/connections?tab=brain&brain=documents');
+ });
+
+ it('passes a v2 chip through unchanged', () => {
+ expect(renderAt('/brain?tab=context')).toBe('/connections?tab=brain&brain=context');
+ });
+
+ it('drops a sub-tab that names no chip so the page picks its default', () => {
+ expect(renderAt('/brain?tab=welcome')).toBe('/connections?tab=brain');
+ });
+
+ it('maps the sync history view to documents and keeps other params and the hash', () => {
+ expect(renderAt('/brain?tab=sync&view=history&foo=1#x')).toBe(
+ '/connections?tab=brain&brain=documents&foo=1#x'
);
});
});