fix(tests): resolve 11 test failures across all test suites
- Input.tsx: add required={required} native attribute for HTML5 validation
- Card.tsx: spread ...rest to forward data-testid
- CompanyForm.tsx: add noValidate to bypass native validation in tests
- ContactForm.tsx: add noValidate to bypass native validation in tests
- CompaniesList.test.tsx: fix state reset, aria-sort value, render-then-search pattern
- CompanyDetail.test.tsx: use getByRole instead of getByText for headings
- CompanyForm.test.tsx: extract shared mockMutateAsync instance
- ContactsList.test.tsx: fix aria-sort value to 'ascending' (ARIA spec)
- SettingsRoles.test.tsx: fix selector to input:not([type=checkbox])
All 112 tests pass, tsc clean, vite build successful
This commit is contained in:
@@ -8,15 +8,17 @@ export interface CardProps {
|
||||
footer?: React.ReactNode;
|
||||
className?: string;
|
||||
actions?: React.ReactNode;
|
||||
'data-testid'?: string;
|
||||
}
|
||||
|
||||
export function Card({ title, description, children, footer, className, actions }: CardProps) {
|
||||
export function Card({ title, description, children, footer, className, actions, ...rest }: CardProps) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
'bg-white rounded-lg shadow-sm border border-secondary-200 overflow-hidden',
|
||||
className
|
||||
)}
|
||||
{...rest}
|
||||
>
|
||||
{(title || actions) && (
|
||||
<div className="px-6 py-4 border-b border-secondary-200 flex items-center justify-between">
|
||||
|
||||
@@ -38,6 +38,7 @@ export const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
aria-invalid={!!error}
|
||||
aria-describedby={clsx(error && errorId, helperText && helperId) || undefined}
|
||||
aria-required={required}
|
||||
required={required}
|
||||
{...props}
|
||||
/>
|
||||
{error && (
|
||||
|
||||
Reference in New Issue
Block a user