feat: add bundled OpenCode skills and refine module flow
This commit is contained in:
@@ -57,7 +57,25 @@ test.describe('Project configuration skills', () => {
|
||||
await expect(drawer.getByRole('combobox')).toHaveCount(0);
|
||||
await expect(drawer.locator('[data-testid="project-model-list"], [data-testid="project-model-empty-state"]')).toHaveCount(1);
|
||||
}
|
||||
await page.getByRole('button', { name: '关闭' }).click();
|
||||
const closeButton = drawer.getByRole('button', { name: '关闭' });
|
||||
const closeGeometry = await closeButton.evaluate((button) => {
|
||||
const icon = button.querySelector('svg');
|
||||
if (!icon) return null;
|
||||
const buttonRect = button.getBoundingClientRect();
|
||||
const iconRect = icon.getBoundingClientRect();
|
||||
return {
|
||||
button: { x: buttonRect.x, y: buttonRect.y, width: buttonRect.width, height: buttonRect.height },
|
||||
icon: { x: iconRect.x, y: iconRect.y, width: iconRect.width, height: iconRect.height },
|
||||
};
|
||||
});
|
||||
if (!closeGeometry) {
|
||||
throw new Error(`未能读取 ${title} 抽屉关闭按钮的布局区域`);
|
||||
}
|
||||
expect(closeGeometry.button.width).toBe(40);
|
||||
expect(closeGeometry.button.height).toBe(40);
|
||||
expect(Math.abs((closeGeometry.icon.x + closeGeometry.icon.width / 2) - (closeGeometry.button.x + closeGeometry.button.width / 2))).toBeLessThanOrEqual(0.5);
|
||||
expect(Math.abs((closeGeometry.icon.y + closeGeometry.icon.height / 2) - (closeGeometry.button.y + closeGeometry.button.height / 2))).toBeLessThanOrEqual(0.5);
|
||||
await closeButton.locator('svg').click();
|
||||
await expect(page.getByRole('dialog', { name: title })).toHaveCount(0);
|
||||
}
|
||||
|
||||
@@ -94,7 +112,7 @@ test.describe('Project configuration skills', () => {
|
||||
await expect(page.getByTestId('skill-detail-view')).toBeVisible();
|
||||
await expect(page.getByTestId('skill-structure')).toContainText('references/guide.md');
|
||||
await expect(page.getByTestId('skill-main-file')).toContainText('# Browser debugging');
|
||||
await page.getByRole('button', { name: '返回技能列表' }).click();
|
||||
await page.getByRole('button', { name: '返回技能列表' }).locator('svg').click();
|
||||
await expect(page.getByTestId('skill-card-agent-browser')).toBeVisible();
|
||||
await page.getByRole('button', { name: '关闭' }).click();
|
||||
await expect(page.getByTestId('resource-card-publish')).toHaveCount(0);
|
||||
|
||||
Reference in New Issue
Block a user