/* @vitest-environment jsdom */ import { fireEvent, render, screen } from '@testing-library/react'; import { expect, test, vi } from 'vitest'; import { PlatformAcknowledgeStatusDialog } from './PlatformAcknowledgeStatusDialog'; test('renders a standard acknowledge action and closes through 知道了', () => { const onClose = vi.fn(); render( , ); const action = screen.getByRole('button', { name: '知道了' }); expect(action.className).toContain('platform-button'); fireEvent.click(action); expect(onClose).toHaveBeenCalledTimes(1); }); test('supports custom action styling and header notice layout', () => { render( {}} showHeader showCloseButton closeOnBackdrop iconLabel="发布失败提示" actionClassName="border-slate-950 bg-slate-950 text-white" />, ); const action = screen.getByRole('button', { name: '知道了' }); const dialog = screen.getByRole('dialog', { name: '发布失败' }); expect(action.className).toContain('border-slate-950'); expect(action.className).toContain('bg-slate-950'); expect(dialog.querySelector('[aria-label="发布失败提示"]')).toBeTruthy(); });