Error: Not implemented: HTMLFormElement.prototype.submit
See original GitHub issueError
HTMLInputElement {} HTMLInputElement {}
Error: Not implemented: HTMLFormElement.prototype.submit
at module.exports (/home/xlmnxp/Documents/Nodejs/DownFrom99/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
at HTMLFormElementImpl.submit (/home/xlmnxp/Documents/Nodejs/DownFrom99/node_modules/jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js:68:5)
at HTMLFormElement.submit (/home/xlmnxp/Documents/Nodejs/DownFrom99/node_modules/jsdom/lib/jsdom/living/generated/HTMLFormElement.js:18:21)
at /home/xlmnxp/Documents/Nodejs/DownFrom99/app.js:12:10
at process._tickCallback (internal/process/next_tick.js:109:7) undefined
import { JSDOM } from "jsdom";
JSDOM.fromURL("http://localhost/").then((dom:JSDOM) => {
let document = dom.window.document;
let window = dom.window;
let form = <HTMLFormElement> document.querySelector("form");
let urlField = <HTMLInputElement> document.querySelector("input[name='formvalue']");
let submitButton = <HTMLInputElement> document.querySelector("input[type='submit']");
console.log(submitButton,urlField)
urlField.value = "https://www.youtube.com/watch?v=RWjDLfx8Lww";
form.submit()
})
Issue Analytics
- State:
- Created 6 years ago
- Comments:30 (5 by maintainers)
Top Results From Across the Web
Error: Not implemented: HTMLFormElement.prototype.submit
I am receiving "Error: Not implemented: HTMLFormElement.prototype.submit". I tried the solution mentioned here https://github.com/jsdom/jsdom/ ...
Read more >Error: Not implemented: HTMLFormElement.prototype.submit
Error : Not implemented: HTMLFormElement.prototype.submit ... a real form submission with Jest and JSDOM, you have probably seen this error:
Read more >Not implemented: HTMLFormElement.prototype.submit-Reactjs
I had to mock the implementation of my onSubmit function to clear the error, preventing the default submit behavior. Give something like this...
Read more >form.submit is not a function - TrackJS
In this case, we had a reference to a HTMLFormElement , which should have a submit function on its prototype. This is a...
Read more >HTMLFormElement.submit() - Web APIs | MDN
The HTMLFormElement.submit() method submits a given <form> . This method is similar, but not identical to, activating a form's submit ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, indeed, form submission is not implemented. This is working as expected.
Ran into this when writing tests using Jest. My workaround:
Added this before I mount my component in the test case. At least it keeps my console clean.