Skip to content

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

fix(ui): forward test ids from EmptyState

Steven Enamakel03181db4cb05
diff --git a/app/src/components/ui/EmptyState.tsx b/app/src/components/ui/EmptyState.tsx
index 6ecceda5c5..32b7743b09 100644
--- a/app/src/components/ui/EmptyState.tsx
+++ b/app/src/components/ui/EmptyState.tsx
@@ -3,11 +3,24 @@ import { cn } from '../../lib/cn';
export interface EmptyStateProps {
label: string;
className?: string;
+ /**
+ * `data-testid` for the rendered element.
+ *
+ * Declared and forwarded rather than left to fall through: TypeScript allows
+ * ANY hyphenated attribute on a JSX element without checking it against the
+ * props type, so a caller passing `data-testid` to a component that does not
+ * forward it gets no error, no warning, and no attribute — the id simply is
+ * not there, and the spec looking for it fails somewhere unrelated. Every
+ * other primitive that specs target (`ListRow`, `ModalShell`) already takes
+ * one.
+ */
+ 'data-testid'?: string;
}
-const EmptyState = ({ label, className }: EmptyStateProps) => (
+const EmptyState = ({ label, className, 'data-testid': testId }: EmptyStateProps) => (
<p
data-slot="empty-state"
+ data-testid={testId}
className={cn('px-4 py-4 text-xs italic text-content-faint', className)}>
{label}
</p>