Skip to content

TableSelector handle error tests do not run correctly #7768

@khtruong

Description

@khtruong

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

  1. Set breakpoints and "npm run test".
  2. You will see that we are actually failing but the tests are green.

Environment

latest master

Metadata

Metadata

Assignees

No one assigned

    Labels

    !deprecated-label:bugDeprecated label - Use #bug insteadinactiveInactive for >= 30 days

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions