Skip to content

Commit

Permalink
Fix TS
Browse files Browse the repository at this point in the history
  • Loading branch information
mj12albert committed Mar 14, 2024
1 parent cc74c08 commit a5b5109
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 12 additions & 11 deletions packages/mui-base/src/Textarea/Textarea.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ describe('<Textarea />', () => {
});

describe('prop: render', () => {
const Wrapper = React.forwardRef<HTMLTextAreaElement, { children?: React.ReactNode }>(
function Wrapper(props, forwardedRef) {
const { minRows, maxRows, ...otherProps } = props;
return (
<div data-testid="wrapper">
<textarea ref={forwardedRef} {...otherProps} />
</div>
);
},
);
const Wrapper = React.forwardRef<
HTMLTextAreaElement,
{ children?: React.ReactNode; minRows?: number | string; maxRows?: number | string }
>(function Wrapper(props, forwardedRef) {
const { minRows, maxRows, ...otherProps } = props;
return (
<div data-testid="wrapper">
<textarea ref={forwardedRef} {...otherProps} />
</div>
);
});

it('should render the custom component', () => {
const { container, getByTestId } = render(
Expand Down Expand Up @@ -250,7 +251,7 @@ describe('<Textarea />', () => {
// FormData is not available in JSDOM
this.skip();
}
const handleSubmit = (event) => {
const handleSubmit = (event: React.SyntheticEvent<HTMLFormElement>) => {
event.preventDefault();
const formData = new FormData(event.currentTarget);
expect(formData.get('textarea-one')).to.equal('Mozilla Firefox');
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"module": "esnext",
"target": "es5",
"lib": ["es2020", "dom"],
"lib": ["es2020", "dom", "dom.iterable"],
"jsx": "preserve",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
Expand Down

0 comments on commit a5b5109

Please sign in to comment.