import { describe, expect, it } from "vitest";

import { buildSearchQueryVariants } from "./search-query-utils.js";

describe("buildSearchQueryVariants", () => {
  it("keeps the exact keyword only for strict configured stages", () => {
    expect(buildSearchQueryVariants("球墨铸铁井盖 Φ700重型", { strict: true })).toEqual([
      "球墨铸铁井盖 Φ700重型",
    ]);
  });

  it("allows degraded fallback variants for default progressive search", () => {
    expect(buildSearchQueryVariants("球墨铸铁井盖 Φ700重型")).toEqual([
      "球墨铸铁井盖 Φ700重型",
      "球墨铸铁井盖",
    ]);
  });
});