Merge origin/main and preserve nonblocking project entry
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-09-07 12:53:55 +08:00
66 changed files with 4068 additions and 519 deletions

View File

@@ -89,7 +89,6 @@ const officialItem: PluginWorkspaceItem = {
deviceReason: null,
commands: [
{ kind: 'disable_project', projectId: 'project-a', pluginId: 'makelore.data-service' },
{ kind: 'open_agent_assignment', projectId: 'project-a', pluginId: 'makelore.data-service' },
{ kind: 'open_settings', projectId: 'project-a', pluginId: 'makelore.data-service' },
],
official: {
@@ -435,13 +434,13 @@ describe('PluginsView', () => {
expect(screen.getByRole('heading', { name: '插件' })).toBeVisible();
expect(screen.getByText(/MakeLore 运营发布官方插件/)).toBeVisible();
expect(screen.getByText(/获取、项目启用与伙伴分配彼此独立/)).toBeVisible();
expect(screen.getByText(/获取与项目启用彼此独立.*需要定向生效的插件还可分配伙伴/)).toBeVisible();
expect(screen.getByText('开发数据服务')).toBeVisible();
expect(screen.getByText('Pi Web Search')).toBeVisible();
expect(screen.getByRole('heading', { name: '本机全局生效' })).toBeVisible();
expect(screen.getByText('本机全局已启用')).toBeVisible();
expect(screen.getByText('随 MakeLore 提供')).toBeVisible();
expect(screen.getByText('已分配 1 位伙伴')).toBeVisible();
expect(screen.getByText('随项目启用')).toBeVisible();
expect(screen.getAllByRole('alert')).toHaveLength(2);
expect(screen.queryByRole('textbox', { name: /包|路径|source/i })).not.toBeInTheDocument();
expect(screen.getByText(/通过对话安装/)).toBeVisible();
@@ -494,6 +493,10 @@ describe('PluginsView', () => {
expect(screen.getAllByText('随应用提供')).toHaveLength(2);
expect(screen.queryByText('未下载官方包')).not.toBeInTheDocument();
expect(screen.getByText('随项目启用')).toBeVisible();
expect(screen.getByRole('heading', { name: '生效范围' })).toBeVisible();
expect(screen.getByText(/启用当前项目后.*无需单独分配/)).toBeVisible();
expect(screen.queryByRole('heading', { name: '伙伴分配' })).not.toBeInTheDocument();
});
it('shows one dialog detail surface, confirms destructive commands, and embeds Data Service settings', () => {
@@ -505,7 +508,10 @@ describe('PluginsView', () => {
expect(dialog).toHaveTextContent('读取项目名称');
expect(dialog).toHaveTextContent('data-service.documents');
expect(dialog).toHaveTextContent('按平台包含');
expect(dialog).toHaveTextContent('小明');
expect(dialog).toHaveTextContent('生效范围');
expect(dialog).toHaveTextContent('无需单独分配');
expect(dialog).not.toHaveTextContent('小明');
expect(screen.queryByRole('button', { name: '分配开发数据服务给伙伴' })).not.toBeInTheDocument();
expect(dialog).toHaveTextContent('插件专属设置');
expect(dialog).toHaveTextContent('创建开发数据空间');
@@ -731,9 +737,9 @@ describe('PluginsView', () => {
const view = props(officialItem);
render(<MemoryRouter><PluginsView {...view} /></MemoryRouter>);
fireEvent.click(screen.getByRole('button', { name: '分配开发数据服务给伙伴' }));
fireEvent.click(screen.getByRole('button', { name: '查看开发数据服务插件设置' }));
expect(view.onCommand).toHaveBeenCalledWith({
kind: 'open_agent_assignment', projectId: 'project-a', pluginId: 'makelore.data-service',
kind: 'open_settings', projectId: 'project-a', pluginId: 'makelore.data-service',
});
fireEvent.click(screen.getByRole('button', { name: '关闭插件详情' }));
expect(view.onSelect).toHaveBeenCalledWith(null);