Fix worker
This commit is contained in:
@@ -115,6 +115,106 @@ describe('component test harness', () => {
|
||||
expect(onOpenFile).toHaveBeenCalledWith('apps/web/auth.ts');
|
||||
});
|
||||
|
||||
it('keeps the workspace thread focused on user, agent, and tool content', () => {
|
||||
render(
|
||||
<AgentThread
|
||||
jobId='job-1'
|
||||
messages={[
|
||||
{
|
||||
_id: 'message-system',
|
||||
_creationTime: 1,
|
||||
jobId: 'job-1',
|
||||
spoonId: 'spoon-1',
|
||||
ownerId: 'user-1',
|
||||
role: 'system',
|
||||
content: 'Workspace is ready.',
|
||||
status: 'completed',
|
||||
createdAt: 1,
|
||||
updatedAt: 1,
|
||||
} as never,
|
||||
{
|
||||
_id: 'message-empty-assistant',
|
||||
_creationTime: 2,
|
||||
jobId: 'job-1',
|
||||
spoonId: 'spoon-1',
|
||||
ownerId: 'user-1',
|
||||
role: 'assistant',
|
||||
content: '',
|
||||
status: 'completed',
|
||||
createdAt: 2,
|
||||
updatedAt: 2,
|
||||
} as never,
|
||||
{
|
||||
_id: 'message-user',
|
||||
_creationTime: 3,
|
||||
jobId: 'job-1',
|
||||
spoonId: 'spoon-1',
|
||||
ownerId: 'user-1',
|
||||
role: 'user',
|
||||
content: 'Use Authentik as the only provider.',
|
||||
status: 'completed',
|
||||
createdAt: 3,
|
||||
updatedAt: 3,
|
||||
} as never,
|
||||
{
|
||||
_id: 'message-assistant',
|
||||
_creationTime: 4,
|
||||
jobId: 'job-1',
|
||||
spoonId: 'spoon-1',
|
||||
ownerId: 'user-1',
|
||||
role: 'assistant',
|
||||
content: 'I found the Auth.js provider configuration.',
|
||||
status: 'completed',
|
||||
createdAt: 4,
|
||||
updatedAt: 4,
|
||||
} as never,
|
||||
{
|
||||
_id: 'message-tool',
|
||||
_creationTime: 5,
|
||||
jobId: 'job-1',
|
||||
spoonId: 'spoon-1',
|
||||
ownerId: 'user-1',
|
||||
role: 'tool',
|
||||
content: 'rg Authentik',
|
||||
status: 'completed',
|
||||
createdAt: 5,
|
||||
updatedAt: 5,
|
||||
} as never,
|
||||
]}
|
||||
events={[
|
||||
{
|
||||
_id: 'event-info',
|
||||
_creationTime: 1,
|
||||
jobId: 'job-1',
|
||||
level: 'info',
|
||||
phase: 'plan',
|
||||
message: 'Sending message to agent.',
|
||||
createdAt: 1,
|
||||
} as never,
|
||||
]}
|
||||
interactions={[]}
|
||||
workspaceChanges={[]}
|
||||
disabled={false}
|
||||
agentTurnActive={false}
|
||||
onOpenFile={vi.fn()}
|
||||
onOpenDiff={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.queryByText('Workspace is ready.')).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.queryByText('Sending message to agent.'),
|
||||
).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Assistant')).not.toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText('Use Authentik as the only provider.'),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText('I found the Auth.js provider configuration.'),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText('rg Authentik')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders thread workspaces on the canonical thread route', () => {
|
||||
mockUseParams.mockReturnValue({ threadId: 'thread-1' });
|
||||
mockUseQuery.mockReturnValue({
|
||||
|
||||
Reference in New Issue
Block a user