收口前端平台组件库能力

新增 PlatformUiKit 通用弹窗、按钮、状态、空态、媒体、表单和标签等公共组件
迁移结果页、创作工作台、认证入口、RPG 暗色面板和运行态弹窗的重复 UI chrome
补充组件测试、页面回归测试、技术文档和 Hermes 共享决策记录
This commit is contained in:
2026-06-10 10:24:18 +08:00
parent a4ee6ff698
commit 1ad25e30f8
226 changed files with 23364 additions and 7825 deletions

View File

@@ -0,0 +1,39 @@
/* @vitest-environment jsdom */
import { render, screen } from '@testing-library/react';
import { expect, test } from 'vitest';
import { CopyFeedbackMessage } from './CopyFeedbackMessage';
test('renders nothing while copy feedback is idle', () => {
const { container } = render(
<CopyFeedbackMessage state="idle" className="copy-toast" />,
);
expect(container.textContent).toBe('');
});
test('renders copied and failed feedback labels', () => {
const { rerender } = render(
<CopyFeedbackMessage
state="copied"
copiedLabel="分享内容已复制"
failedLabel="分享失败"
className="copy-toast"
/>,
);
const copied = screen.getByText('分享内容已复制');
expect(copied.className).toContain('copy-toast');
rerender(
<CopyFeedbackMessage
state="failed"
copiedLabel="分享内容已复制"
failedLabel="分享失败"
className="copy-toast"
/>,
);
expect(screen.getByText('分享失败')).toBeTruthy();
});