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.

746 B
Raw Blame
import { expect, it } from "vite-plus/test";
import { findRemovedProjectIds } from "./find-removed-project-ids";

it("returns projects missing from the refreshed list", () => {
  expect(
    findRemovedProjectIds(
      [{ id: "kept" }, { id: "removed" }, { id: "also-removed" }],
      [{ id: "kept" }, { id: "added" }],
    ),
  ).toEqual(["removed", "also-removed"]);
});

it("reports each removed project once", () => {
  expect(
    findRemovedProjectIds([{ id: "removed" }, { id: "removed" }], []),
  ).toEqual(["removed"]);
});

it("removes nothing when either list is unknown", () => {
  expect(findRemovedProjectIds(undefined, [{ id: "kept" }])).toEqual([]);
  expect(findRemovedProjectIds([{ id: "kept" }], undefined)).toEqual([]);
});