Commit Graph

3 Commits

Author SHA1 Message Date
CodingOnStar
e2edcdb0cf fix(tests): normalize path handling in useDocLink mock for document processing tests
- Updated the mock implementation of useDocLink to strip leading slashes from paths, aligning with actual implementation behavior.
- This change ensures that the generated documentation URLs are consistent and accurate, improving the reliability of tests that depend on this mock.

These adjustments enhance the overall stability and correctness of the testing suite for document processing components.
2025-12-19 13:46:11 +08:00
CodingOnStar
dae130d8d2 refactor(tests): improve mock document creation and enhance test stability
- Updated the  function to use a deterministic counter for IDs, reducing flakiness in tests.
- Ensured the ID counter resets before each test to maintain reproducibility.
- Adjusted assertions in the  tests to explicitly check for error handling when the documents array is empty, improving clarity and reliability of edge case testing.
- Fixed a link in the  tests to ensure it points to the correct documentation URL.

These changes enhance the robustness and reliability of the testing suite for document processing components.
2025-12-18 18:50:21 +08:00
CodingOnStar
bd9402c90b feat(tests): add comprehensive tests for Processing and EmbeddingProcess components
- Introduced new test files for Processing and EmbeddingProcess components, covering rendering, props variations, edge cases, and memoization.
- Added mock implementations for external dependencies to facilitate testing.
- Enhanced Jest configuration to handle module resolution for lodash and ky.
- Created a mock for the ky HTTP client to avoid ESM issues in Jest tests.
- Updated Processing component to handle optional chaining for retrieval method.

This commit significantly improves test coverage and stability for the document processing features.
2025-12-18 17:10:51 +08:00