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:
@@ -106,7 +106,7 @@ export function CompanyFormPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
|
||||
<form onSubmit={handleSubmit(onSubmit)} noValidate className="space-y-4">
|
||||
<Card title={t('companies.name')}>
|
||||
<Input
|
||||
{...register('name')}
|
||||
|
||||
@@ -115,7 +115,7 @@ export function ContactFormPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-4">
|
||||
<form onSubmit={handleSubmit(onSubmit)} noValidate className="space-y-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
||||
<Card title={t('contacts.firstName')}>
|
||||
<Input
|
||||
|
||||
Reference in New Issue
Block a user