/* @vitest-environment jsdom */ import { render, screen } from '@testing-library/react'; import { expect, test } from 'vitest'; import { PlatformRuntimeStatusToast } from './PlatformRuntimeStatusToast'; test('renders error runtime toast with alert semantics', () => { render( 操作失败 , ); const toast = screen.getByRole('alert'); expect(toast.className).toContain('platform-runtime-status-toast'); expect(toast.className).toContain('rounded-full'); expect(toast.className).toContain( 'text-[var(--platform-button-danger-text)]', ); expect(toast.className).toContain('mt-2'); expect(toast.getAttribute('aria-live')).toBe('assertive'); }); test('supports dark and solid runtime surfaces', () => { const { rerender } = render( 命中 , ); expect(screen.getByRole('status').className).toContain( 'border-emerald-200/35', ); expect(screen.getByRole('status').className).toContain('rounded-[1.2rem]'); rerender( 运行失败 , ); expect(screen.getByRole('alert').className).toContain('bg-rose-600'); expect(screen.getByRole('alert').className).toContain('px-4'); });