argos-ci / jest-puppeteer

Run tests using Jest & Puppeteer 🎪✨
MIT License
3.53k stars 288 forks source link

react-toastify bug #350

Closed ngustavo closed 3 years ago

ngustavo commented 4 years ago

🐛 Bug Report

Running tests on a form which sends an http request, while waiting for a toastify popup saying it was successful throws this error.

Error: The element you provided cannot be rendered. You provided an element of type object

      at ToastContainer.buildToast (http:/localhost:3000/static/js/0.chunk.js:106457:13)
      at http:/localhost:3000/static/js/0.chunk.js:106386:34
      at http:/localhost:3000/static/js/0.chunk.js:105841:18
      at Suite.<anonymous> (src/__tests__/Home.test.js:27:3)

Inside the puppeteer instance, console says the http response is 404 as well.

To Reproduce

Have a form with react-toastify in use. Install jest-puppeteer and add this config:

server: {
    command: 'react-app-rewired start',
    launchTimeout: 10000,
    port: 3000,
},

Expected behavior

Tests run fine with manual config for Jest and Puppeteer or without the jest-dev-server config. Expected this to get a 200 response and render the popup properly.

envinfo

## System:
 - OS: Linux 5.3 Linux Mint 19.3 (Tricia)
 - CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
 - Memory: 1.29 GB / 7.79 GB
 - Container: Yes
 - Shell: 4.4.20 - /bin/bash
## Binaries:
 - Node: 12.16.1 - ~/.nvm/versions/node/v12.16.1/bin/node
 - Yarn: 1.22.4 - ~/.nvm/versions/node/v12.16.1/bin/yarn
 - npm: 6.13.4 - ~/.nvm/versions/node/v12.16.1/bin/npm
## npmPackages:
 - jest-puppeteer: ^4.4.0 => 4.4.0 
UziTech commented 3 years ago

is this still an issue?

ngustavo commented 3 years ago

I don't have access to the source code anymore. I remember I couldn't get around it so I moved to react-testing-library.