Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T02:00:23.682Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

commandPalette.test.ts

25 lines · 759 B · typescript
1import { describe, expect, it } from "vitest";
2import { filterCommands, nextActiveIndex } from "./commandPalette";
3
4describe("command palette", () => {
5  it("wraps keyboard focus in both directions", () => {
6    expect(nextActiveIndex(2, "next", 3)).toBe(0);
7    expect(nextActiveIndex(0, "previous", 3)).toBe(2);
8  });
9
10  it("returns an honest empty state", () => {
11    expect(nextActiveIndex(0, "next", 0)).toBe(-1);
12  });
13
14  it("matches labels and keywords", () => {
15    const commands = [
16      { id: "new", label: "New note", keywords: ["create"], run() {} },
17      { id: "share", label: "Share note", keywords: ["invite"], run() {} },
18    ];
19
20    expect(filterCommands(commands, "invite").map(({ id }) => id)).toEqual([
21      "share",
22    ]);
23  });
24});
25
Served at tenant.openagents/omega Member data and write actions are omitted.