Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
In my unit test file, I am using jest-dom to simulate a DOM.
to the page. I would now like to add a unit test which confirms the submit button sends an HTTP request. How can I do that using the Jest testing framework? Here are some more details: In my test file, I've successfully rendered the form to the test DOM, and simulated a click to the submit button. How can I now assert that an HTTP request has been made? Any HTTP request will do for now. And I don't need any specific response from the HTTP request. In my unit test file, I am using jest-dom to simulate a DOM. The element in-question is rendered using vanilla JS. I'm not using React or any other framework. Thanks in advance.