收口 Makelore 客户端变更
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-08-12 22:35:06 +08:00
parent 253bad8b40
commit f4113a872f
232 changed files with 4617 additions and 20121 deletions

View File

@@ -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();
});
});