Skip to content

Commit ffefbad

Browse files
V2dhaljharb
authored andcommitted
[Tests] no-noninteractive-element-interactions: add passing tests for form with onSubmit
Closes #323.
1 parent 0c19f02 commit ffefbad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

__tests__/src/rules/no-noninteractive-element-interactions-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ const alwaysValid = [
110110
{ code: '<embed onClick={() => {}} />;' },
111111
{ code: '<font onClick={() => {}} />;' },
112112
{ code: '<font onSubmit={() => {}} />;' },
113+
{ code: '<form onSubmit={() => {}} />;' },
114+
{
115+
code: `
116+
<form onSubmit={this.handleSubmit.bind(this)} method="POST">
117+
<button type="submit">
118+
Save
119+
</button>
120+
</form>
121+
`,
122+
},
113123
{ code: '<frameset onClick={() => {}} />;' },
114124
{ code: '<head onClick={() => {}} />;' },
115125
{ code: '<header onClick={() => {}} />;' },

0 commit comments

Comments
 (0)