diff --git a/components/home/MaterialCard.test.tsx b/components/home/MaterialCard.test.tsx index 30ddc9f..166505d 100644 --- a/components/home/MaterialCard.test.tsx +++ b/components/home/MaterialCard.test.tsx @@ -119,8 +119,8 @@ describe('MaterialCard', () => { expect(screen.getByText('未设置')).toBeInTheDocument() }) - test('15天策略隐藏源地址时仍显示视频转码进度', () => { - render( + test('15天策略隐藏源地址时仍显示视频转码进度,提示不遮挡预览', () => { + const { container } = render( { expect(screen.getByRole('status')).toHaveTextContent('等待中') expect(screen.getByRole('progressbar')).toHaveAttribute('aria-valuenow', '5') - expect(screen.getByText('15天后可查看详情')).toBeInTheDocument() + const previewArea = container.querySelector('[data-material-link="true"]') + const notice = screen.getByText('15天后可查看详情') + expect(previewArea).not.toBeNull() + expect(previewArea).not.toContainElement(notice) + expect(notice).toHaveAttribute('data-video-preview-notice', 'true') }) test('视频卡片初始只加载封面,悬停时才挂载视频预览', () => { diff --git a/components/home/MaterialCard.tsx b/components/home/MaterialCard.tsx index d6f085a..1d470a0 100644 --- a/components/home/MaterialCard.tsx +++ b/components/home/MaterialCard.tsx @@ -568,13 +568,6 @@ export default function MaterialCard({ {Math.floor(material.videoDuration / 60)}:{(material.videoDuration % 60).toString().padStart(2, '0')} )} - {isPreviewWaiting && ( -
-
- {material.videoPreviewRemainingDays || videoDownloadAvailability.remainingDays || VIDEO_DOWNLOAD_WAIT_DAYS}天后可查看详情 -
-
- )}
@@ -599,6 +592,14 @@ export default function MaterialCard({ > ID {material.id}

+ {isPreviewWaiting && ( +

+ {material.videoPreviewRemainingDays || videoDownloadAvailability.remainingDays || VIDEO_DOWNLOAD_WAIT_DAYS}天后可查看详情 +

+ )}