There are a few tests in spec/javascripts/components/TableSelector_spec.jsx that do not properly test promises: "fetchSchemas.should dispatch a danger toast on error" and "fetchTables.should dispatch a danger toast on error". These tests are not returning a promise and Jest just calls the promise and continues onto the next test. This causes false positives.
The fix is to return the promise in the test. But when the tests are updated to return a promise, there are more errors. This issues tracks fixing up these unit tests.
Expected results
Verifies the promise logic correctly.
Actual results
Tests call the promise and move on to the next test, giving a false positive.
How to reproduce the bug
- Set breakpoints and "npm run test".
- You will see that we are actually failing but the tests are green.
Environment
latest master
There are a few tests in spec/javascripts/components/TableSelector_spec.jsx that do not properly test promises: "fetchSchemas.should dispatch a danger toast on error" and "fetchTables.should dispatch a danger toast on error". These tests are not returning a promise and Jest just calls the promise and continues onto the next test. This causes false positives.
The fix is to return the promise in the test. But when the tests are updated to return a promise, there are more errors. This issues tracks fixing up these unit tests.
Expected results
Verifies the promise logic correctly.
Actual results
Tests call the promise and move on to the next test, giving a false positive.
How to reproduce the bug
Environment
latest master