diff --git a/components/home/MaterialCard.test.tsx b/components/home/MaterialCard.test.tsx index 166505d..aa14c69 100644 --- a/components/home/MaterialCard.test.tsx +++ b/components/home/MaterialCard.test.tsx @@ -119,7 +119,7 @@ describe('MaterialCard', () => { expect(screen.getByText('未设置')).toBeInTheDocument() }) - test('15天策略隐藏源地址时仍显示视频转码进度,提示不遮挡预览', () => { + test('15天策略隐藏源地址时仍显示视频转码进度,提示保留且没有整图蒙版', () => { const { container } = render( { const previewArea = container.querySelector('[data-material-link="true"]') const notice = screen.getByText('15天后可查看详情') expect(previewArea).not.toBeNull() - expect(previewArea).not.toContainElement(notice) + expect(previewArea).toContainElement(notice) expect(notice).toHaveAttribute('data-video-preview-notice', 'true') + expect(notice.parentElement).not.toHaveClass('bg-[#fafafa]/55') }) test('视频卡片初始只加载封面,悬停时才挂载视频预览', () => { diff --git a/components/home/MaterialCard.tsx b/components/home/MaterialCard.tsx index 1d470a0..4a2e598 100644 --- a/components/home/MaterialCard.tsx +++ b/components/home/MaterialCard.tsx @@ -568,6 +568,16 @@ 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}天后可查看详情 +
+
+ )}
@@ -592,15 +602,6 @@ export default function MaterialCard({ > ID {material.id}

- {isPreviewWaiting && ( -

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

- )} -