Skip to content

Commit

Permalink
validate that the error state correctly is applied
Browse files Browse the repository at this point in the history
  • Loading branch information
feclist committed Nov 15, 2024
1 parent dc639e3 commit cebed49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/components/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const TextArea = forwardRef(
required={required}
rows={numRows}
className={cx(styles.textArea, [styles[size]], { [styles.resize]: resize })}
aria-invalid={error}
aria-invalid={isErrorState}
aria-describedby={ariaDescribedby}
onChange={handleOnChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ describe("TextArea", () => {

expect(input).toHaveValue("12345678910");
expect(charCount).toHaveTextContent("11/10");
expect(input).toHaveAttribute("aria-invalid", "true");
});

it("should allow text removal when character limit is exceeded", () => {
Expand Down

0 comments on commit cebed49

Please sign in to comment.