mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-25 23:00:32 +08:00
In preparation for merging radicle-desktop into radicle-gui. It's a pure rename, so git can follow every file across the move.
18 lines
436 B
TypeScript
18 lines
436 B
TypeScript
import { expect, test } from "vitest";
|
|
|
|
import { menuFocusIndex } from "@app/lib/menuNavigation";
|
|
|
|
test.each([
|
|
["ArrowDown", -1, 0],
|
|
["ArrowDown", 0, 1],
|
|
["ArrowDown", 2, 0],
|
|
["ArrowUp", -1, 2],
|
|
["ArrowUp", 0, 2],
|
|
["ArrowUp", 2, 1],
|
|
["Home", 1, 0],
|
|
["End", 0, 2],
|
|
["Enter", 1, undefined],
|
|
])("%j from %j of three focuses %j", (key, current, expected) => {
|
|
expect(menuFocusIndex(key, current, 3)).toBe(expected);
|
|
});
|