mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-04-19 01:43:08 +08:00
fix: pre-release fixes for code formatting, i18n, and test suite
- Run cargo fmt to fix Rust code formatting (lib.rs) - Add missing i18n keys: migration.success, agents.title (zh/en/ja) - Replace hardcoded strings "Agents" and "MCP" with t() calls in App.tsx - Fix test mocks and assertions: - Add providersApi.updateTrayMenu to useSettings.test.tsx mock - Update SettingsPage mock path in App.test.tsx - Fix toast message assertion in integration/SettingsDialog.test.tsx - Add autoSaveSettings to SettingsDialog component test mock - Fix loading state test to check spinner instead of title - Update import button name matching for selected file state - Fix save button test to switch to advanced tab first - Remove obsolete cancel button test (button no longer exists) Test results improved from 99 passed / 17 failed to 104 passed / 11 failed
This commit is contained in:
@@ -8,6 +8,7 @@ const useSettingsQueryMock = vi.fn();
|
||||
const setAppConfigDirOverrideMock = vi.fn();
|
||||
const applyClaudePluginConfigMock = vi.fn();
|
||||
const syncCurrentProvidersLiveMock = vi.fn();
|
||||
const updateTrayMenuMock = vi.fn();
|
||||
const toastErrorMock = vi.fn();
|
||||
const toastSuccessMock = vi.fn();
|
||||
|
||||
@@ -52,6 +53,9 @@ vi.mock("@/lib/api", () => ({
|
||||
syncCurrentProvidersLive: (...args: unknown[]) =>
|
||||
syncCurrentProvidersLiveMock(...args),
|
||||
},
|
||||
providersApi: {
|
||||
updateTrayMenu: (...args: unknown[]) => updateTrayMenuMock(...args),
|
||||
},
|
||||
}));
|
||||
|
||||
const createSettingsFormMock = (overrides: Record<string, unknown> = {}) => ({
|
||||
|
||||
Reference in New Issue
Block a user