diff --git a/__mocks__/lucide-react.tsx b/__mocks__/lucide-react.tsx index 38b2544b..78370dde 100644 --- a/__mocks__/lucide-react.tsx +++ b/__mocks__/lucide-react.tsx @@ -98,3 +98,10 @@ export function ChevronRight(props: Readonly<{ className?: string }>): ReactElem export function ChevronDown(props: Readonly<{ className?: string }>): ReactElement { return ; } + +/** + * Stub for the ListFilter icon, marking the catalog's filter control. + */ +export function ListFilter(props: Readonly<{ className?: string }>): ReactElement { + return ; +} diff --git a/__mocks__/platform-bible-react.tsx b/__mocks__/platform-bible-react.tsx index 7f651507..9f46c8ec 100644 --- a/__mocks__/platform-bible-react.tsx +++ b/__mocks__/platform-bible-react.tsx @@ -459,6 +459,65 @@ export const Input = forwardRef< ); }); +/** + * Stub search bar. The real component wraps a platform `Input` in a positioned container with a + * search icon and, once the query is non-empty, a clear button that reports `''`; this stub keeps + * the input and that button and drops the icon and positioning, which are visual only. + * + * It takes no `aria-label` and puts its `id` on the wrapper rather than the input, exactly as the + * real component does, so the input's accessible name comes from its placeholder alone — which is + * how a test has to find it. + */ +export const SearchBar = forwardRef< + HTMLInputElement, + Readonly<{ + value: string; + onSearch: (searchQuery: string) => void; + placeholder?: string; + isFullWidth?: boolean; + className?: string; + isDisabled?: boolean; + id?: string; + }> +>(function SearchBarImpl( + { value, onSearch, placeholder, isFullWidth: _isFullWidth, className, isDisabled, id }, + ref, +) { + return ( +
` the real component produces, taking its + * `data-testid` from the `id` prop as that component does. + */ +export function EmptyState({ + message, + id, + className, +}: Readonly<{ message: string; id?: string; className?: string }>): ReactElement { + return ( +
+ {message} +
+ ); +} + /** * Stub textarea rendered as a native `