0
0
Fork 0

set up Mocha/Chai/Enzyme for React component unit testing

This commit is contained in:
Kai Schaper 2016-10-10 04:01:10 +02:00
parent 77efdfa110
commit d7c55853e9
3 changed files with 24 additions and 4 deletions

View file

@ -0,0 +1,13 @@
import { expect } from 'chai';
import { shallow } from 'enzyme';
import React from 'react';
global.React = React;
import LoadingIndicator from '../../../app/assets/javascripts/components/components/loading_indicator'
describe('<LoadingIndicator />', function() {
it('renders text that indicates loading', function() {
const wrapper = shallow(<LoadingIndicator />);
expect(wrapper.text()).to.match(/loading/i);
});
});