Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Example: stencil component with a form and test #677

Open
toddjspin opened this issue Oct 13, 2023 · 0 comments
Open

Add Example: stencil component with a form and test #677

toddjspin opened this issue Oct 13, 2023 · 0 comments

Comments

@toddjspin
Copy link

Can you add a test example of a stencil component that has a form that calls a method in that component with the onSubmit. I can't get this to work in the test as it seems the method that is called is being mocked by jest. Thanks!

`<form name="claimSearchForm" onReset={() => this.resetForm()}
onSubmit={(e) => this.handleSubmit(e)} ref={(el) => this.claimForm = el as HTMLFormElement}
class="needs-validation" novalidate enctype="multipart/form-data">

async handleSubmit(e) {
console.log("handle called");
e.preventDefault();
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant