// src/test/setup.ts
var import_vitest = require("@testing-library/jest-dom/vitest");
var import_vitest2 = require("vitest");
import_vitest2.vi.mock("antd", async () => {
  const actual = await import_vitest2.vi.importActual("antd");
  return {
    ...actual,
    message: {
      success: import_vitest2.vi.fn(),
      error: import_vitest2.vi.fn(),
      warning: import_vitest2.vi.fn(),
      info: import_vitest2.vi.fn()
    }
  };
});
import_vitest2.vi.mock("@pisell/utils", () => ({
  locales: {
    init: import_vitest2.vi.fn(),
    getLocale: () => "zh-CN",
    getText: (key, ...args) => {
      const mockTexts = {
        "pisell-login2-check-email-title": "请检查您的邮箱",
        "pisell-login2-check-phone-title": "请检查您的手机",
        "pisell-login2-check-email-desc": "我们已向您的邮箱发送了验证码",
        "pisell-login2-check-phone-desc": "我们已向您的手机发送了验证码",
        "pisell-login2-no-email-received": "没有收到邮件？",
        "pisell-login2-no-message-received": "没有收到短信？",
        "pisell-login2-login-button": "登录",
        "pisell-login2-back": "返回",
        "pisell-login2-resend": "重新发送",
        // Selector 组件相关
        "pisell2.pro.selector.mode.single": "单选",
        "pisell2.pro.selector.mode.multiple": "多选",
        "pisell2.pro.selector.validate.required-msg": "请选择",
        "pisell2.pro.selector.validate.requireOneOf-msg": "该组必须选择指定集合之一",
        "pisell2.pro.selector.required-tag": "必选",
        "pisell2.pro.selector.validate.min-selection": (min) => `至少选择 ${min} 个选项`,
        "pisell2.pro.selector.validate.max-selection": (max) => `最多选择 ${max} 个选项`,
        "pisell2.pro.selector.tip.min-max-selection": (min, max) => {
          const _minText = `至少选择 ${min} 个选项`;
          const _maxText = `最多选择 ${max} 个选项`;
          return `${_minText}, ${_maxText}`;
        }
      };
      const text = mockTexts[key];
      if (typeof text === "function") {
        return text(...args);
      }
      return text || key;
    }
  }
}));
import_vitest2.vi.mock("../../hooks/useEngineContext", () => ({
  default: () => ({
    engine: {
      get: import_vitest2.vi.fn(),
      set: import_vitest2.vi.fn()
    }
  }),
  usePisellOS: () => ({
    engine: {
      get: import_vitest2.vi.fn(),
      set: import_vitest2.vi.fn()
    }
  })
}));
import_vitest2.vi.mock("@pisell/materials", () => ({
  Iconfont: ({ name, ...props }) => {
    const React = require("react");
    return React.createElement("span", { "data-testid": `icon-${name}`, ...props });
  }
}));
import_vitest2.vi.mock("*.less", () => ({}));
import_vitest2.vi.mock("classnames", () => ({
  default: (...args) => args.filter(Boolean).join(" ")
}));
global.ResizeObserver = import_vitest2.vi.fn().mockImplementation(() => ({
  observe: import_vitest2.vi.fn(),
  unobserve: import_vitest2.vi.fn(),
  disconnect: import_vitest2.vi.fn()
}));
Object.defineProperty(window, "matchMedia", {
  writable: true,
  value: import_vitest2.vi.fn().mockImplementation((query) => ({
    matches: false,
    media: query,
    onchange: null,
    addListener: import_vitest2.vi.fn(),
    removeListener: import_vitest2.vi.fn(),
    addEventListener: import_vitest2.vi.fn(),
    removeEventListener: import_vitest2.vi.fn(),
    dispatchEvent: import_vitest2.vi.fn()
  }))
});
