修复泥点弹窗透明问题
为泥点消耗确认弹窗补齐平台主题作用域和模态面板样式 让平台状态弹窗合并默认主题遮罩,避免自定义遮罩覆盖主题变量 补充弹窗默认样式测试和团队排障记录
This commit is contained in:
@@ -21,6 +21,7 @@ test('renders result state with description and primary action', () => {
|
||||
);
|
||||
|
||||
const dialog = screen.getByRole('dialog', { name: '支付成功' });
|
||||
const overlay = dialog.parentElement as HTMLElement;
|
||||
const badge = dialog.querySelector('.platform-icon-badge');
|
||||
const action = screen.getByRole('button', { name: '知道了' });
|
||||
const visibleDescription = dialog.querySelector(
|
||||
@@ -28,6 +29,8 @@ test('renders result state with description and primary action', () => {
|
||||
);
|
||||
|
||||
expect(dialog).toBeTruthy();
|
||||
expect(overlay.className).toContain('platform-theme--light');
|
||||
expect(overlay.className).toContain('platform-profile-modal-overlay');
|
||||
expect(visibleDescription?.textContent).toBe('账户状态已刷新');
|
||||
expect(badge?.className).toContain('text-[var(--platform-success-text)]');
|
||||
expect(action.className).toContain('platform-primary-button');
|
||||
@@ -97,6 +100,27 @@ test('supports custom badge icon label and action button styling', () => {
|
||||
expect(action.className).toContain('bg-slate-950');
|
||||
});
|
||||
|
||||
test('keeps default theme classes when callers customize the overlay', () => {
|
||||
render(
|
||||
<PlatformStatusDialog
|
||||
status="error"
|
||||
title="发布失败"
|
||||
description="图片生成失败"
|
||||
onClose={vi.fn()}
|
||||
overlayClassName="bg-slate-950/58 custom-overlay"
|
||||
action={{ label: '知道了', onClick: vi.fn(), surface: 'platform' }}
|
||||
/>,
|
||||
);
|
||||
|
||||
const dialog = screen.getByRole('dialog', { name: '发布失败' });
|
||||
const overlay = dialog.parentElement as HTMLElement;
|
||||
|
||||
expect(overlay.className).toContain('platform-theme--light');
|
||||
expect(overlay.className).toContain('platform-profile-modal-overlay');
|
||||
expect(overlay.className).toContain('bg-slate-950/58');
|
||||
expect(overlay.className).toContain('custom-overlay');
|
||||
});
|
||||
|
||||
test('supports header notice layout with body content and close button', () => {
|
||||
const onClose = vi.fn();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user