about summary refs log tree commit diff
path: root/spec/javascript
diff options
context:
space:
mode:
authorKai Schaper <303@posteo.de>2016-10-10 04:01:10 +0200
committerKai Schaper <303@posteo.de>2016-10-10 22:48:58 +0200
commitd7c55853e9d180290ae3cb30b2f329ebab8748ce (patch)
tree9db1d8353db63018a02065c8d3d55318ddc796d2 /spec/javascript
parent77efdfa1104a77061f014bbc84268028597620cb (diff)
set up Mocha/Chai/Enzyme for React component unit testing
Diffstat (limited to 'spec/javascript')
-rw-r--r--spec/javascript/components/loading_indicator.test.jsx13
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);
+  });
+});