MCPcopy
hub / github.com/coder/mux / findMenuItem

Function findMenuItem

tests/ui/workspaces/subagents.test.ts:82–94  ·  view source on GitHub ↗
(label: string)

Source from the content-addressed store, hash-verified

80}
81
82async function findMenuItem(label: string): Promise<HTMLButtonElement> {
83 return waitFor(
84 () => {
85 const buttons = Array.from(document.querySelectorAll("button")) as HTMLButtonElement[];
86 const menuItem = buttons.find((button) => button.textContent?.includes(label));
87 if (!menuItem) {
88 throw new Error(`Menu item not found: ${label}`);
89 }
90 return menuItem;
91 },
92 { timeout: 10_000 }
93 );
94}
95
96function getAncestorTrunkSegments(container: HTMLElement, workspaceId: string): HTMLElement[] {
97 const connector = getSubagentConnector(container, workspaceId);

Callers 1

subagents.test.tsFile · 0.85

Calls 1

waitForFunction · 0.50

Tested by

no test coverage detected