feat: consolidate plugin navigation

This commit is contained in:
inman
2026-08-31 16:30:17 +08:00
parent 38f85f6b5e
commit b3f4166f21
12 changed files with 227 additions and 69 deletions

View File

@@ -92,4 +92,14 @@ describe('Project Plugin Center', () => {
fireEvent.click(screen.getByRole('button', { name: '从项目禁用保留插件 makelore.removed' }));
expect(onSetEnabled).toHaveBeenCalledWith('makelore.removed', false);
});
it('embeds project enablement in configuration and returns to Agent assignment explicitly', () => {
const onManageAgents = vi.fn();
render(<MemoryRouter><ProjectPluginsView embedded projectName="Demo" projection={projection()} dataService={null} pending={{}} agentNames={{}} onRefresh={vi.fn()} onSetEnabled={vi.fn()} onConfigure={vi.fn()} onReset={vi.fn()} onRemoveCollection={vi.fn()} onRemoveProject={vi.fn()} onManageAgents={onManageAgents} /></MemoryRouter>);
expect(screen.getByTestId('project-plugins-page').tagName).toBe('SECTION');
expect(screen.queryByRole('heading', { name: '项目插件' })).not.toBeInTheDocument();
fireEvent.click(screen.getByRole('button', { name: '分配给伙伴' }));
expect(onManageAgents).toHaveBeenCalledTimes(1);
});
});