收口 Makelore 客户端变更
This commit is contained in:
@@ -70,4 +70,42 @@ describe('Makelore character scene partner profiles', () => {
|
||||
});
|
||||
expect(hostApiFetchMock.mock.calls.some(([path]) => String(path).includes('/api/opencode/agents'))).toBe(false);
|
||||
});
|
||||
|
||||
it('opens an installed Skill detail with its structure and main file', async () => {
|
||||
const project = {
|
||||
id: 'project-1',
|
||||
path: 'D:/projects/project-1',
|
||||
name: '详情测试项目',
|
||||
createdAt: '2026-01-01T00:00:00.000Z',
|
||||
updatedAt: '2026-01-01T00:00:00.000Z',
|
||||
lastOpenedAt: '2026-01-01T00:00:00.000Z',
|
||||
};
|
||||
useOpencodeStore.setState({ activeProject: project, projects: [project] });
|
||||
hostApiFetchMock.mockResolvedValue({
|
||||
skills: [{
|
||||
name: 'pm-project-plan',
|
||||
description: 'E2E project planning skill.',
|
||||
location: 'D:/managed/skills/pm-project-plan/SKILL.md',
|
||||
content: '# Project planning',
|
||||
entries: [
|
||||
{ path: 'references', type: 'directory' },
|
||||
{ path: 'references/guide.md', type: 'file' },
|
||||
{ path: 'SKILL.md', type: 'file' },
|
||||
],
|
||||
}],
|
||||
});
|
||||
|
||||
render(<MemoryRouter><CharacterScene /></MemoryRouter>);
|
||||
|
||||
fireEvent.click(screen.getByTestId('resource-card-skills'));
|
||||
await screen.findByText('opencode 已安装');
|
||||
fireEvent.click(screen.getByTestId('skill-library-card-pm-project-plan'));
|
||||
|
||||
expect(await screen.findByTestId('skill-detail-view')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('skill-structure')).toHaveTextContent('references/guide.md');
|
||||
expect(screen.getByTestId('skill-main-file')).toHaveTextContent('# Project planning');
|
||||
|
||||
fireEvent.click(screen.getByRole('button', { name: '返回技能列表' }));
|
||||
expect(await screen.findByTestId('skill-library-card-pm-project-plan')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user