Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): update UserActionBar test to verify disabled state

Steven Enamakel09fddd7a25f2
diff --git a/app/src/components/assistant-ui/__tests__/UserActionBar.test.tsx b/app/src/components/assistant-ui/__tests__/UserActionBar.test.tsx
index 2d90a3f3c2..452d44e8a6 100644
--- a/app/src/components/assistant-ui/__tests__/UserActionBar.test.tsx
+++ b/app/src/components/assistant-ui/__tests__/UserActionBar.test.tsx
@@ -76,17 +76,17 @@ describe('User-message action bar — capability-gated Edit (#5897)', () => {
expect(container.querySelector('.aui-user-action-bar-root')).not.toBeNull();
});
- it('does not offer an Edit control while the runtime cannot edit', async () => {
+ it('offers an Edit control now that the runtime can edit', async () => {
const { container } = renderThreadWithOneUserMessage();
await waitFor(() => {
expect(screen.getByText('hover me')).toBeInTheDocument();
});
- // `useOpenHumanExternalStore` implements neither `onEdit` nor
- // `setMessages`, so assistant-ui reports `edit: false` and the gate must
- // withhold the button. Asserted by the class the product CSS and the
- // browser spec both key on.
- expect(container.querySelectorAll('.aui-user-action-edit')).toHaveLength(0);
+ // `useOpenHumanExternalStore` now implements `onEdit` (`threads.edit_message`)
+ // and `setMessages` (a no-op that only exists to un-gate `BranchPicker`),
+ // so assistant-ui reports `edit: true` and the gate renders the button.
+ // Asserted by the class the product CSS and the browser spec both key on.
+ expect(container.querySelectorAll('.aui-user-action-edit')).toHaveLength(1);
});
});