Files
cc-switch/tests/setupTests.ts
T
千羽and千羽 57b1eff1d4 feat(ui): v8 — theme color, unified controls, motion, virtual lists (#7816)
Unify the visual and interaction rules on top of the v7 redesign.

- Theme color #F97315 for --action-* and --ring; dark mode uses #EA580C
  with white text, toned-down mode colors and translucent soft fills
- Buttons mapped to three sizes (28 / 32 / 36); inputs, selects and
  search fields share fieldClass; self-drawn checkbox and radio
- HoverTip replaces title on about 100 icon buttons; it stays closed
  when a closing menu returns focus to its trigger
- Install tailwindcss-animate so menu, popover, dialog and tooltip
  enter/exit animations take effect; sliding segment thumb and tab
  underline
- Remove the command palette and the header prompt entry; provider card
  primary actions become icon buttons
- Virtualize the session list and the Skills discovery list; optimistic
  toggles for MCP and Skills with a 300ms delayed disabled state
- Toasts drawn unstyled with status-colored icons and de-duplicated
- Windows: hide the system title bar and use in-app window controls;
  macOS: brand row under the traffic lights
- Focus rings only for keyboard users
- Skills discovery and the prompt list show the last result from a
  local cache and refresh in the background
- Drop the trailing ellipsis from 36 dialog-opening labels
- Provider list fills the main area

Co-authored-by: 千羽 <qyinter@users.noreply.github.com>
2026-10-03 23:28:59 +08:00

39 lines
1016 B
TypeScript

import "@testing-library/jest-dom";
import { afterAll, afterEach, beforeAll, vi } from "vitest";
import { cleanup } from "@testing-library/react";
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import { server } from "./msw/server";
import { resetProviderState } from "./msw/state";
import "./msw/tauriMocks";
beforeAll(async () => {
server.listen({ onUnhandledRequest: "warn" });
await i18n.use(initReactI18next).init({
lng: "zh",
fallbackLng: "zh",
resources: {
zh: { translation: {} },
en: { translation: {} },
},
interpolation: {
escapeValue: false,
},
});
});
afterEach(() => {
cleanup();
// 页面数据的本地缓存(src/lib/localCache.ts)不能从一个用例带到下一个
for (const key of Object.keys(localStorage)) {
if (key.startsWith("cc-switch-cache:")) localStorage.removeItem(key);
}
resetProviderState();
server.resetHandlers();
vi.clearAllMocks();
});
afterAll(() => {
server.close();
});