Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

708 B
Raw Blame
import { describe, expect, it } from "vite-plus/test";
import { isPerTaskRelationQuery } from "./relation-query-keys";

const q = (queryKey: readonly unknown[]) => ({ queryKey });

describe("isPerTaskRelationQuery", () => {
  it("matches a per-task relation query", () => {
    expect(isPerTaskRelationQuery(q(["task-relations", "task-1"]))).toBe(true);
  });

  it("excludes the project-scoped query", () => {
    expect(
      isPerTaskRelationQuery(q(["task-relations", "project", "project-1"])),
    ).toBe(false);
  });

  it("ignores unrelated queries", () => {
    expect(isPerTaskRelationQuery(q(["tasks", "project-1"]))).toBe(false);
    expect(isPerTaskRelationQuery(q([]))).toBe(false);
  });
});