import { describe, expect, it } from "vitest";
import { textMatchesAnyKeyword, textMatchesKeyword } from "./keyword-match.js";

describe("keyword-match", () => {
  it("matches co-op title against coop deal-breaker token", () => {
    expect(
      textMatchesKeyword(
        "Co-op Software Development Engineer in Test (SDET)",
        "coop",
      ),
    ).toBe(true);
    expect(textMatchesKeyword("Co-op SDET", "co-op")).toBe(true);
  });

  it("matches intern in employer or title", () => {
    expect(textMatchesAnyKeyword("Acme Intern Program", ["intern"])).toBe(true);
    expect(
      textMatchesAnyKeyword("Global Relay Communications Inc.", ["intern"]),
    ).toBe(false);
  });
});
