mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-24 12:41:56 +08:00
* test: enhance download and fetch utility test coverage - Add MIME type handling tests for data URLs in download.test.ts - Add timestamp generation tests for blob and network downloads - Add Content-Type header handling test for extensionless files - Add format parameter tests (markdown/html/text) for fetchWebContent - Add timeout signal handling tests for fetch operations - Add combined signal (user + timeout) test for AbortSignal.any These tests improve coverage of edge cases and ensure critical functionality is properly tested. * fix: add missing error handling for fetch in download utility - Add .catch() handler for network request failures in download() - Use window.message.error() for user-friendly error notifications - Update tests to verify error handling behavior - Ensure proper error messages are shown to users This fixes a missing error handler that was discovered during test development. * refactor: improve test structure and add i18n support for download utility - Unified test structure with two-layer describe blocks (filename -> function name) - Added afterEach with restoreAllMocks for consistent mock cleanup - Removed individual mockRestore calls in favor of centralized cleanup - Added i18n support to download.ts for error messages - Updated error handling logic to avoid duplicate messages - Updated test expectations to match new i18n error messages * test: fix react-i18next mock for Markdown test Add missing initReactI18next to mock to resolve test failures caused by i18n initialization when download utility imports i18n module. |
||
|---|---|---|
| .. | ||
| main | ||
| preload | ||
| renderer | ||