[PR #29323] add @testing-library/user-event and create tests for external-knowledge-base/ #32370

Closed
opened 2026-02-21 20:51:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/29323

State: closed
Merged: Yes


/create:

Metric Value
Test File index.spec.tsx
Total Tests 60
Test Categories 13
Statement Coverage 100%
Branch Coverage 93.44%
Function Coverage 100%

/connector:

Metric Coverage
Test File index.spec.tsx
Statements 100%
Branches 100%
Functions 100%
Lines 100%

Mock Dependencies

Mock Target Description
next/navigation Next.js router (useRouter)
react-i18next Internationalization (useTranslation)
@/context/i18n Documentation link (useDocLink)
@/context/modal-context Modal context (useModalContext)
@/context/external-knowledge-api-context External API context (useExternalKnowledgeApi)

Covered Components

Component Statement Coverage Branch Coverage Function Coverage
index.tsx 100% 91.66% 100%
ExternalApiSelect.tsx 100% 100% 100%
ExternalApiSelection.tsx 100% 93.33% 100%
RetrievalSettings.tsx 100% 100% 100%
InfoPanel.tsx 100% 100% 100%
KnowledgeBaseInfo.tsx 100% 75%* 100%
**Original Pull Request:** https://github.com/langgenius/dify/pull/29323 **State:** closed **Merged:** Yes --- /create: | Metric | Value | |--------|-------| | **Test File** | `index.spec.tsx` | | **Total Tests** | 60 | | **Test Categories** | 13 | | **Statement Coverage** | 100% | | **Branch Coverage** | 93.44% | | **Function Coverage** | 100% | /connector: | Metric | Coverage | |--------|----------| | **Test File** | `index.spec.tsx` | | Statements | 100% | | Branches | 100% | | Functions | 100% | | Lines | 100% | ## Mock Dependencies | Mock Target | Description | |-------------|-------------| | `next/navigation` | Next.js router (`useRouter`) | | `react-i18next` | Internationalization (`useTranslation`) | | `@/context/i18n` | Documentation link (`useDocLink`) | | `@/context/modal-context` | Modal context (`useModalContext`) | | `@/context/external-knowledge-api-context` | External API context (`useExternalKnowledgeApi`) | ## Covered Components | Component | Statement Coverage | Branch Coverage | Function Coverage | |-----------|-------------------|-----------------|-------------------| | `index.tsx` | 100% | 91.66% | 100% | | `ExternalApiSelect.tsx` | 100% | 100% | 100% | | `ExternalApiSelection.tsx` | 100% | 93.33% | 100% | | `RetrievalSettings.tsx` | 100% | 100% | 100% | | `InfoPanel.tsx` | 100% | 100% | 100% | | `KnowledgeBaseInfo.tsx` | 100% | 75%* | 100% |
yindo added the pull-request label 2026-02-21 20:51:16 -05:00
yindo closed this issue 2026-02-21 20:51:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#32370