generated from react-component/footer
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: rm onPressEnter * fix: fix * fix: fix
- Loading branch information
1 parent
7b5c922
commit 0c31fe5
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { render } from '@testing-library/react'; | ||
import React from 'react'; | ||
import type { ResizableTextAreaRef, TextAreaProps } from '../src'; | ||
import { ResizableTextArea } from '../src'; | ||
|
||
const resizableTextAreaProps = () => (global as any).textAreaProps; | ||
|
||
jest.mock('../src/ResizableTextArea', () => { | ||
const ReactReal: typeof React = jest.requireActual('react'); | ||
const Resizable = jest.requireActual('../src/ResizableTextArea'); | ||
const ResizableComponent = Resizable.default; | ||
return ReactReal.forwardRef<ResizableTextAreaRef, TextAreaProps>( | ||
(props, ref) => { | ||
(global as any).textAreaProps = props; | ||
return <ResizableComponent {...props} ref={ref} />; | ||
}, | ||
); | ||
}); | ||
|
||
it('should have no onPressEnter prop', () => { | ||
render(<ResizableTextArea defaultValue="test" />); | ||
expect(resizableTextAreaProps().onPressEnter).toBeUndefined(); | ||
}); |