收口前端平台组件库能力
新增 PlatformUiKit 通用弹窗、按钮、状态、空态、媒体、表单和标签等公共组件 迁移结果页、创作工作台、认证入口、RPG 暗色面板和运行态弹窗的重复 UI chrome 补充组件测试、页面回归测试、技术文档和 Hermes 共享决策记录
This commit is contained in:
@@ -31,7 +31,21 @@ test('PlatformFeedbackView renders reference feedback fields', () => {
|
||||
expect(screen.getByText('上传凭证')).toBeTruthy();
|
||||
expect(screen.getByLabelText('联系电话')).toBeTruthy();
|
||||
expect(screen.getByRole('button', { name: '提交' })).toBeTruthy();
|
||||
expect(screen.getByRole('button', { name: '查看反馈与投诉记录' })).toBeTruthy();
|
||||
expect(
|
||||
screen.getByRole('button', { name: '查看反馈与投诉记录' }),
|
||||
).toBeTruthy();
|
||||
|
||||
const descriptionPanel = screen.getByLabelText('问题描述').closest('section');
|
||||
const evidencePanel = screen
|
||||
.getByText('上传凭证(提供问题截图)')
|
||||
.closest('section');
|
||||
const phonePanel = screen.getByLabelText('联系电话').closest('section');
|
||||
|
||||
for (const panel of [descriptionPanel, evidencePanel, phonePanel]) {
|
||||
expect(panel?.className).toContain('platform-subpanel');
|
||||
expect(panel?.className).toContain('rounded-[1.25rem]');
|
||||
expect(panel?.className).toContain('p-4');
|
||||
}
|
||||
});
|
||||
|
||||
test('PlatformFeedbackView validates minimum description length before submit', () => {
|
||||
@@ -73,9 +87,12 @@ test('PlatformFeedbackView previews image data urls and submits evidence items',
|
||||
render(<PlatformFeedbackView onBack={vi.fn()} onSubmit={onSubmit} />);
|
||||
|
||||
const file = new File(['feedback'], 'preview.png', { type: 'image/png' });
|
||||
fireEvent.change(document.querySelector('input[type="file"]') as HTMLInputElement, {
|
||||
target: { files: [file] },
|
||||
});
|
||||
fireEvent.change(
|
||||
document.querySelector('input[type="file"]') as HTMLInputElement,
|
||||
{
|
||||
target: { files: [file] },
|
||||
},
|
||||
);
|
||||
|
||||
const preview = await screen.findByAltText('反馈凭证预览');
|
||||
expect(preview.getAttribute('src')).toBe(
|
||||
|
||||
Reference in New Issue
Block a user