Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions packages/web/src/pages/agent/agent-home-page.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/// <reference types="bun" />

import {afterEach, describe, expect, test} from 'bun:test';
import {cleanup, render, screen} from '@testing-library/react';
import {createMemoryRouter, RouterProvider} from 'react-router';
import {AgentSide} from '@/components/agent-side';
import {AgentHomePage} from '@/pages/agent/agent-home-page';

afterEach(() => {
cleanup();
});

describe('AgentHomePage', () => {
test('directs a login without access to the Connections page', async () => {
const router = createMemoryRouter(
[
{
id: 'agent',
loader: () => ({
agent: {id: 'agent-1', providerId: 'claude', name: 'Claude'},
connections: [],
}),
element: <AgentSide />,
children: [{path: '/agent', element: <AgentHomePage />}],
},
],
{initialEntries: ['/agent']},
);

render(<RouterProvider router={router} />);

expect(
await screen.findByText(
'No connections are available to this login yet. Ask the person who set it up to add a service on the Connections page, or give this login access to one already connected.',
),
).toBeDefined();
});
});
3 changes: 2 additions & 1 deletion packages/web/src/pages/agent/agent-home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ export function AgentHomePage() {
</div>
{connections.length === 0 && (
<p className="text-sm text-muted-foreground md:px-3">
This login has no access yet. Ask the person who made it to give it some.
No connections are available to this login yet. Ask the person who set it up to add a
service on the Connections page, or give this login access to one already connected.
</p>
)}
{connections.map((connection) => {
Expand Down
Loading