feat: add bundled OpenCode skills and refine module flow
This commit is contained in:
@@ -344,6 +344,40 @@ describe('AgentConversationSidebar', () => {
|
||||
})));
|
||||
});
|
||||
|
||||
it('defaults only the planning Skills and leaves presentation optional', async () => {
|
||||
hostApiFetchMock.mockResolvedValue({
|
||||
skills: [
|
||||
{ name: 'agent-browser' },
|
||||
{ name: 'frontend-slides' },
|
||||
{ name: 'grilling' },
|
||||
{ name: 'planning-with-files' },
|
||||
],
|
||||
});
|
||||
const callbacks = renderSidebar();
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '创建伙伴' }));
|
||||
|
||||
const grilling = await screen.findByLabelText('绑定技能:方案质询');
|
||||
const planning = await screen.findByLabelText('绑定技能:项目规划');
|
||||
const slides = await screen.findByLabelText('绑定技能:项目演示');
|
||||
const browser = await screen.findByLabelText('绑定技能:开发浏览器');
|
||||
await waitFor(() => {
|
||||
expect(grilling).toBeChecked();
|
||||
expect(planning).toBeChecked();
|
||||
expect(slides).not.toBeChecked();
|
||||
expect(browser).not.toBeChecked();
|
||||
});
|
||||
fireEvent.click(grilling);
|
||||
expect(grilling).not.toBeChecked();
|
||||
fireEvent.change(screen.getByLabelText(/伙伴名称/), { target: { value: '小李' } });
|
||||
fireEvent.change(screen.getByLabelText(/职责简述/), { target: { value: '负责整理资料。' } });
|
||||
fireEvent.click(screen.getByRole('button', { name: '创建并开始对话' }));
|
||||
|
||||
await waitFor(() => expect(callbacks.onCreateAgent).toHaveBeenCalledWith(expect.objectContaining({
|
||||
skillIds: ['planning-with-files'],
|
||||
})));
|
||||
});
|
||||
|
||||
it('shows advanced creation settings directly below the basics', () => {
|
||||
renderSidebar();
|
||||
fireEvent.click(screen.getByRole('button', { name: '创建伙伴' }));
|
||||
|
||||
Reference in New Issue
Block a user