import { describe, expect, it } from "vitest";
import { resolveSearchOpenMode } from "./shortcuts";

describe("resolveSearchOpenMode", () => {
  it("Ctrl/Cmd+Enter 打开新窗口", () => {
    expect(resolveSearchOpenMode({ ctrlKey: true })).toBe("new-window");
    expect(resolveSearchOpenMode({ metaKey: true, altKey: true })).toBe("new-window");
  });

  it("Alt+Enter 打开右侧预览", () => {
    expect(resolveSearchOpenMode({ altKey: true })).toBe("sidebar");
  });

  it("默认回车在当前窗口打开", () => {
    expect(resolveSearchOpenMode({})).toBe("main");
  });
});
