Skip to content

Formerly KrillinAI, VideoTranslation and Dubbing Tool for 120+ Languages. Open-source AI workspace for creators, powered by Codex. Video downloader, video translation, create videos, images, audios, and edits with Agents in one place. For your Social Media like YouTube, TikTok, Instagram, etc.

test(web): align issue assertions with public diagnostics

Leggettf7263a236d9f
diff --git a/apps/web/src/features/dashboard/VideoTranslationAgentPanel.test.tsx b/apps/web/src/features/dashboard/VideoTranslationAgentPanel.test.tsx
index 92ece8ee..54d7535d 100644
--- a/apps/web/src/features/dashboard/VideoTranslationAgentPanel.test.tsx
+++ b/apps/web/src/features/dashboard/VideoTranslationAgentPanel.test.tsx
@@ -105,7 +105,7 @@ describe('VideoTranslationAgentPanel', () => {
fireEvent.change(composer, { target: { value: '合成横屏视频' } });
fireEvent.click(screen.getByRole('button', { name: '发送给 Agent' }));
- expect(await screen.findByText('Agent 未能完成诊断,请查看问题详情后重试。')).toBeInTheDocument();
+ expect(await screen.findByText(/Agent 未能完成诊断,请查看问题详情后重试。 错误码:CLIENT_OPERATION_FAILED。/)).toBeInTheDocument();
expect(screen.queryByText('Creator Agent is not ready')).not.toBeInTheDocument();
expect(composer).toHaveValue('合成横屏视频');
});
diff --git a/apps/web/src/features/issues/IssuePresenter.test.tsx b/apps/web/src/features/issues/IssuePresenter.test.tsx
index bcd5d552..2833ed86 100644
--- a/apps/web/src/features/issues/IssuePresenter.test.tsx
+++ b/apps/web/src/features/issues/IssuePresenter.test.tsx
@@ -53,8 +53,9 @@ describe('IssuePresenter', () => {
</PageIssueRoutingProvider>
</LanguageProvider>
);
- expect(screen.getAllByText('上传未完成,请重试。')).toHaveLength(1);
- expect(screen.getAllByText('上传未完成,请重试。')[0]!.closest('[data-issue-id]')).toHaveAttribute('data-issue-id', 'creator-1');
+ const descriptions = screen.getAllByText(/上传未完成,请重试。 错误码:creator_upload_failed。/);
+ expect(descriptions).toHaveLength(1);
+ expect(descriptions[0]!.closest('[data-issue-id]')).toHaveAttribute('data-issue-id', 'creator-1');
});
});
diff --git a/apps/web/src/features/runs/AttachmentTray.test.tsx b/apps/web/src/features/runs/AttachmentTray.test.tsx
index 6d14c9f7..88e36a85 100644
--- a/apps/web/src/features/runs/AttachmentTray.test.tsx
+++ b/apps/web/src/features/runs/AttachmentTray.test.tsx
@@ -41,7 +41,7 @@ describe('AttachmentTray', () => {
expect(screen.getByRole('img', { name: 'ready.png' })).toBeInTheDocument();
expect(screen.getByRole('status', { name: '正在上传 uploading.png' })).toBeInTheDocument();
- expect(screen.getByRole('alert')).toHaveTextContent('网络错误');
+ expect(screen.getByText('网络错误').closest('[role="status"]')).toBeInTheDocument();
await user.click(screen.getByRole('button', { name: '移除附件 ready.png' }));
await user.click(screen.getByRole('button', { name: '重试上传 failed.png' }));
expect(onRemove).toHaveBeenCalledWith('ready');