/* @vitest-environment jsdom */ import { render, screen } from '@testing-library/react'; import { expect, test, vi } from 'vitest'; import { PlatformDetailShareActions } from './PlatformDetailShareActions'; test('renders overlay detail share actions with copied share state', () => { render( 已发布} variant="overlay" />, ); const codeButton = screen.getByRole('button', { name: '复制作品号 CW-001' }); const shareButton = screen.getByRole('button', { name: '分享作品 测试世界' }); expect(screen.getByText('已发布')).toBeTruthy(); expect(codeButton.className).toContain('bg-white/72'); expect(codeButton.className).toContain('tracking-[0.18em]'); expect(shareButton.className).toContain('bg-white/72'); expect(screen.getByText('已复制')).toBeTruthy(); }); test('renders solid detail share actions with compact work code chip', () => { render( 已发布} variant="solid" />, ); const codeButton = screen.getByRole('button', { name: 'PZ-001' }); const shareButton = screen.getByRole('button', { name: '分享作品 拼图世界' }); expect(codeButton.className).toContain('bg-[var(--platform-neutral-bg)]'); expect(shareButton.className).toContain('bg-[var(--platform-neutral-bg)]'); expect(screen.getByText('已发布')).toBeTruthy(); });