收口大鱼结果页失败状态弹窗

扩展 PlatformStatusDialog 支持自定义图标标签与动作按钮透传
BigFishResultView 改用共享状态弹窗承接发布失败提示
更新 PlatformUiKit 收口文档与团队决策记录
This commit is contained in:
2026-06-10 20:36:25 +08:00
parent f54c3ee936
commit 547e771f75
5 changed files with 70 additions and 27 deletions

View File

@@ -1,5 +1,6 @@
/* @vitest-environment jsdom */
import { Waves } from 'lucide-react';
import { fireEvent, render, screen } from '@testing-library/react';
import { expect, test, vi } from 'vitest';
@@ -65,3 +66,33 @@ test('supports blocking confirming state without close action', () => {
expect(onClose).not.toHaveBeenCalled();
});
test('supports custom badge icon label and action button styling', () => {
render(
<PlatformStatusDialog
status="error"
title="发布失败"
description="还缺少 16 个基础动作"
onClose={vi.fn()}
icon={<Waves className="h-4 w-4" />}
iconLabel="发布失败提示"
iconClassName="bg-[var(--platform-button-danger-fill)] text-[var(--platform-button-danger-text)]"
action={{
label: '知道了',
onClick: vi.fn(),
surface: 'platform',
className: 'border-slate-950 bg-slate-950 text-white',
}}
/>,
);
const badge = screen.getByLabelText('发布失败提示');
const action = screen.getByRole('button', { name: '知道了' });
expect(badge.className).toContain('bg-[var(--platform-button-danger-fill)]');
expect(badge.className).toContain(
'text-[var(--platform-button-danger-text)]',
);
expect(action.className).toContain('border-slate-950');
expect(action.className).toContain('bg-slate-950');
});