set up Mocha/Chai/Enzyme for React component unit testing
This commit is contained in:
parent
77efdfa110
commit
d7c55853e9
3 changed files with 24 additions and 4 deletions
13
spec/javascript/components/loading_indicator.test.jsx
Normal file
13
spec/javascript/components/loading_indicator.test.jsx
Normal 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);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue