feat: simplify code project creation
This commit is contained in:
@@ -199,6 +199,24 @@ describe('CodingChatPanel first Conversation', () => {
|
||||
vi.resetModules();
|
||||
});
|
||||
|
||||
it('keeps a project with no Agent accessible and offers optional Agent setup', async () => {
|
||||
const openProjectSettings = vi.fn();
|
||||
projectApi.list.mockResolvedValue({ projects: [project], activeProjectId: project.id });
|
||||
projectApi.config.mockResolvedValue({
|
||||
project,
|
||||
config: { ...configForAgents([]), initialized: false },
|
||||
});
|
||||
projectApi.conversations.mockResolvedValue([]);
|
||||
const { CodingChatPanel } = await import('@/pages/Chat/CodingChatPanel');
|
||||
|
||||
render(<CodingChatPanel onOpenProjectSettings={openProjectSettings} />);
|
||||
|
||||
expect(await screen.findByTestId('coding-chat-empty-agent')).toHaveTextContent('项目已准备好');
|
||||
expect(projectApi.create).not.toHaveBeenCalled();
|
||||
fireEvent.click(screen.getByRole('button', { name: '创建项目智能体' }));
|
||||
expect(openProjectSettings).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
it('makes the first-Conversation textarea editable while runtime metadata is held', async () => {
|
||||
projectApi.list.mockResolvedValue({ projects: [project], activeProjectId: project.id });
|
||||
projectApi.config.mockResolvedValue({ project, config });
|
||||
|
||||
Reference in New Issue
Block a user