Skip to content

Commit

Permalink
Add Textarea test
Browse files Browse the repository at this point in the history
  • Loading branch information
tcbegley committed May 14, 2024
1 parent aaf63d4 commit 8c20fda
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/components/input/__tests__/Textarea.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ describe('Textarea', () => {
expect(mockSetProps.mock.calls).toHaveLength(0);
});

test("don't increment n_submit if submit_on_enter is false", () => {
mockSetProps = jest.fn();
const {
container: {firstChild: ta}
} = render(<Textarea submit_on_enter={false} setProps={mockSetProps} />);
fireEvent.keyPress(ta, {key: 'Enter', code: 13, charCode: 13});
expect(mockSetProps.mock.calls).toHaveLength(0);
});

describe('debounce', () => {
let textarea, mockSetProps;
beforeEach(() => {
Expand Down

0 comments on commit 8c20fda

Please sign in to comment.