diff options
author | Kai Schaper <303@posteo.de> | 2016-10-10 04:01:10 +0200 |
---|---|---|
committer | Kai Schaper <303@posteo.de> | 2016-10-10 22:48:58 +0200 |
commit | d7c55853e9d180290ae3cb30b2f329ebab8748ce (patch) | |
tree | 9db1d8353db63018a02065c8d3d55318ddc796d2 /spec/javascript/components | |
parent | 77efdfa1104a77061f014bbc84268028597620cb (diff) |
set up Mocha/Chai/Enzyme for React component unit testing
Diffstat (limited to 'spec/javascript/components')
-rw-r--r-- | spec/javascript/components/loading_indicator.test.jsx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/javascript/components/loading_indicator.test.jsx b/spec/javascript/components/loading_indicator.test.jsx new file mode 100644 index 000000000..b2f9c919e --- /dev/null +++ b/spec/javascript/components/loading_indicator.test.jsx @@ -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); + }); +}); |