git save current version as 0.05

This commit is contained in:
liaibo
2025-12-01 07:22:08 +08:00
parent 140bce9768
commit ddff19672b
1279 changed files with 82021 additions and 421 deletions
@@ -0,0 +1,45 @@
import { expect, test } from '@playwright/test';
const STORY_URL = '/iframe.html?id=mindmap-kmindrenderer--interactive-lab&viewMode=story';
test.describe('KMind Storybook 场景', () => {
test('浮动工具栏可以插入节点并触发保存状态', async ({ page }) => {
await page.goto(STORY_URL, { waitUntil: 'domcontentloaded' });
await page.getByTestId('mindmap-focus-root').click();
await page.getByTestId('mindmap-selected-text-value').waitFor({ state: 'visible' });
await page.getByText('KMind 产品规划').first().click();
const countEl = page.getByTestId('mindmap-node-count-value');
const initialCount = Number(await countEl.textContent());
const childButton = page.getByRole('button', { name: '子节点' }).first();
await childButton.waitFor({ state: 'visible' });
await childButton.click();
await expect(countEl).toHaveText(String(initialCount + 1));
await expect(page.getByTestId('mindmap-save-state')).toHaveText('已保存', {
timeout: 10_000,
});
});
test('禅模式遮罩可进入并退出', async ({ page }) => {
await page.goto(STORY_URL, { waitUntil: 'domcontentloaded' });
await page.getByTestId('mindmap-zen-open').click();
await expect(page.getByTestId('mindmap-zen-overlay')).toBeVisible();
await page.getByTestId('mindmap-zen-exit').click();
await expect(page.getByTestId('mindmap-zen-overlay')).toBeHidden();
});
test('大纲预览按钮可模拟 Alt+Click 悬浮预览', async ({ page }) => {
await page.goto(STORY_URL, { waitUntil: 'domcontentloaded' });
await page.getByRole('tab', { name: '大纲' }).click();
await page.getByTestId('outline-preview-node-ux-guide').click();
await page.getByRole('tab', { name: '预览' }).click();
await page.getByTestId('mindmap-preview-panel').waitFor({ state: 'visible' });
await expect(page.getByTestId('mindmap-preview-title')).toContainText('体验指南');
await expect(page.getByTestId('mindmap-preview-link')).toHaveText(
'app://document/design-guide'
);
});
});