Because testing seems to be less understood than many other things we should create a few examples of testing for people to see.
I think the biggest thing people want to test is opening the modal and asserting various facts about the contents of the modal.
We should create examples for the following:
Please provide some examples on how to access the portal using enzyme
"jest" involves snapshot example with react-test-renderer ?
if this helps anyone, I had to add a dummy app element to get around the App element is not defined error in Jest:
let app = document.createElement('div');
app.id = 'app';
document
.getElementsByTagName('body')
.item(0)
.appendChild(app);
Modal.setAppElement('#app');
@aziz I ended up piping some innerHTML to jest snapshots, but I did find this helpful:
http://remarkablemark.org/blog/2017/05/17/testing-react-modal/
Most helpful comment
Please provide some examples on how to access the portal using enzyme