chore(integration): snapshot local main worktree

This commit is contained in:
inman committed 2026-08-31 10:23:21 +08:00
1 parent 48a9189939
commit 33fb31fb28
116 files changed
+8108 -3026

No files matched your search

+17 -17
View File
@@ -6,7 +6,7 @@ import { createCodingProjectConfigV2 } from '../../electron/coding-projects/proj
test.describe('Project configuration skills', () => {
test('does not expose the removed Superpowers feature and supports Skill details', async ({ launchElectronApp }) => {
const parentPath = await mkdtemp(path.join(tmpdir(), 'niancode-project-configuration-e2e-'));
const parentPath = await mkdtemp(path.join(tmpdir(), 'makelore-project-configuration-e2e-'));
const app = await launchElectronApp({ skipSetup: true });
try {
@@ -33,16 +33,16 @@ test.describe('Project configuration skills', () => {
await expect(page.getByTestId('project-configuration-page')).toBeVisible();
await expect(page.getByTestId('sidebar-nav-publish')).toHaveCount(0);
await expect(page.getByText(/新项目还没有伙伴/)).toHaveCount(0);
await expect(page.getByText(/新项目还没有智能体/)).toHaveCount(0);
await expect(page.getByTestId('project-configuration-actions')).toBeVisible();
const actionBarBottomGap = await page.getByTestId('project-configuration-actions').evaluate((element) => window.innerHeight - element.getBoundingClientRect().bottom);
expect(actionBarBottomGap).toBeLessThan(40);
await expect(page.getByRole('button', { name: '创建伙伴' })).toBeVisible();
await expect(page.getByRole('button', { name: '创建智能体' })).toBeVisible();
for (const [resourceId, title] of [
['resource-card-models', '大脑(大语言模型)'],
['resource-card-knowledge', '笔记本(知识库)'],
['resource-card-skills', '工具箱(技能)'],
['resource-card-models', '可用模型'],
['resource-card-knowledge', '知识文件'],
['resource-card-skills', '可用技能'],
] as const) {
await page.getByTestId(resourceId).click();
const drawer = page.getByRole('dialog', { name: title });
@@ -74,21 +74,21 @@ test.describe('Project configuration skills', () => {
}
const now = new Date().toISOString();
await mkdir(path.join(parentPath, '.niancode'), { recursive: true });
await writeFile(path.join(parentPath, '.niancode', 'project.json'), JSON.stringify({
await mkdir(path.join(parentPath, '.makelore'), { recursive: true });
await writeFile(path.join(parentPath, '.makelore', 'project.json'), JSON.stringify({
...createCodingProjectConfigV2(now, 'mini_game'),
initialized: true,
agents: [{
id: 'e2e-partner',
id: 'e2e-agent',
avatarId: 'avatar-01',
roleName: '项目伙伴',
name: 'E2E伙伴',
roleName: '项目智能体',
name: 'E2E智能体',
builtIn: false,
enabled: true,
model: { accountId: 'moonshot', modelId: 'kimi-k2.6', thinkingLevel: 'off' },
modelResolution: 'resolved',
skillIds: [],
responsibility: { mission: '验证伙伴维护弹窗。', owns: [], boundaries: [], collaborators: [], principles: [] },
responsibility: { mission: '验证智能体编辑弹窗。', owns: [], boundaries: [], collaborators: [], principles: [] },
prompt: '',
archivedAt: null,
pinned: false,
@@ -152,16 +152,16 @@ test.describe('Project configuration skills', () => {
await expect(publishDialog.getByText('重新选择')).toBeVisible();
await publishDialog.getByRole('button', { name: '取消' }).click();
const agentCard = page.getByTestId('project-agent-e2e-partner');
await expect(agentCard).toContainText('E2E伙伴');
const agentCard = page.getByTestId('project-agent-e2e-agent');
await expect(agentCard).toContainText('E2E智能体');
await agentCard.click();
const maintenanceDialog = page.getByRole('dialog', { name: 'E2E伙伴 · 伙伴维护' });
const maintenanceDialog = page.getByRole('dialog', { name: 'E2E智能体 · 编辑智能体' });
await expect(maintenanceDialog).toBeVisible();
await expect(maintenanceDialog.getByLabel(/伙伴名称/)).toHaveValue('E2E伙伴');
await expect(maintenanceDialog.getByLabel(/智能体名称/)).toHaveValue('E2E智能体');
await maintenanceDialog.getByRole('button', { name: '更换头像' }).click();
const avatarDialog = page.getByRole('dialog', { name: '选择头像' });
await expect(avatarDialog).toBeVisible();
await avatarDialog.getByLabel('上传伙伴头像').setInputFiles(path.join(process.cwd(), 'src/assets/agent-avatars/avatar-01.png'));
await avatarDialog.getByLabel('上传智能体头像').setInputFiles(path.join(process.cwd(), 'src/assets/agent-avatars/avatar-01.png'));
await expect(avatarDialog).toHaveCount(0);
await expect(maintenanceDialog.getByAltText('当前上传头像')).toBeVisible();
await expect(page.getByText('完成配置')).toHaveCount(0);