Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This sample repo does not seem to be testing React components #19

Open
andersr opened this issue Feb 17, 2016 · 1 comment
Open

This sample repo does not seem to be testing React components #19

andersr opened this issue Feb 17, 2016 · 1 comment

Comments

@andersr
Copy link

andersr commented Feb 17, 2016

I was reviewing this repo and trying to understand how React components are being tested. However, it appears as if React components are not being tested at all.

UI/React Components do not appear in the velocity test summary:
The following files, even though they are in the test directory, are not listed in the velocity test summary:

/tests/components/ui/account-summary-spec.jsx:

describe('Bank Transfer Component', function () {
  describe('doTransfer', function () { ...

/tests/components/ui/bank-transfer-spec.jsx:

describe('Account Summary Component', function () { ...

screen shot 2016-02-17 at 3 52 23 pm

Removing everything (except the required render call) has no impact on test results:

I made the following changes. All tests still pass.

/src/client/components/bank-transfer.jsx

BankTransfer = React.createClass({
  render() {
    return (
       <div className="bank-transfer">
     FOO
       </div>
    );
  }
});

/src/client/components/account-summary.jsx

AccountSummary = React.createClass({
  render() {
    return (
       <div className="account-summary">
         $ <span className="account-summary__balance">FOO</span>
       </div>
    );
  }
});

So, my questions are:

  • Why do the tests above not appear in the test summary?
  • Why do tests pass even when removing all code from the components?
  • Should a best practices repo like this not also include tests of the actual components?
@cwohlman
Copy link

Hi @andersr, this repo actually uses several different tools to run tests, including chimp, karma & velocity. Currently velocity only runs jasmine unit tests, and UI tests are run using karma or wallaby.

Take a look at the docs: https://github.com/xolvio/automated-testing-best-practices#installation--usage you'll need to look at your console for the results to both feature & UI tests (unless you're using wallaby in which case UI tests will show up in wallaby).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants