mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-02 02:00:31 +08:00
27 lines
755 B
TypeScript
27 lines
755 B
TypeScript
import { describe, expect, test } from "vitest";
|
|
import * as issue from "@app/lib/issue";
|
|
|
|
describe("Issues", () => {
|
|
test.each([
|
|
{
|
|
currentArray: ["a", "b"],
|
|
newArray: ["a", "b", "c"],
|
|
expected: { add: ["c"], remove: [] },
|
|
},
|
|
{
|
|
currentArray: ["a", "b"],
|
|
newArray: ["c"],
|
|
expected: { add: ["c"], remove: ["a", "b"] },
|
|
},
|
|
{ currentArray: [], newArray: ["c"], expected: { add: ["c"], remove: [] } },
|
|
{ currentArray: ["a"], newArray: ["a"], expected: { add: [], remove: [] } },
|
|
])(
|
|
"createAssigneeArrays $hash => $expected",
|
|
({ currentArray, newArray, expected }) => {
|
|
expect(issue.createAddRemoveArrays(currentArray, newArray)).toEqual(
|
|
expected,
|
|
);
|
|
},
|
|
);
|
|
});
|