feat: enhance accessibility and testing with data-test attributes and improve error handling
This commit is contained in:
@@ -68,6 +68,7 @@ export function GenerateDocumentForm({ accountSlug, initialType }: Props) {
|
||||
<select
|
||||
id="documentType"
|
||||
name="documentType"
|
||||
data-test="document-type-select"
|
||||
value={selectedType}
|
||||
onChange={(e) => {
|
||||
setSelectedType(e.target.value);
|
||||
@@ -190,7 +191,11 @@ export function GenerateDocumentForm({ accountSlug, initialType }: Props) {
|
||||
|
||||
{/* Submit button */}
|
||||
<div className="flex justify-end">
|
||||
<Button type="submit" disabled={isPending || isComingSoon}>
|
||||
<Button
|
||||
type="submit"
|
||||
data-test="document-generate-btn"
|
||||
disabled={isPending || isComingSoon}
|
||||
>
|
||||
{isPending ? (
|
||||
<>
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
|
||||
Reference in New Issue
Block a user