From d7c55853e9d180290ae3cb30b2f329ebab8748ce Mon Sep 17 00:00:00 2001 From: Kai Schaper <303@posteo.de> Date: Mon, 10 Oct 2016 04:01:10 +0200 Subject: set up Mocha/Chai/Enzyme for React component unit testing --- spec/javascript/components/loading_indicator.test.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spec/javascript/components/loading_indicator.test.jsx (limited to 'spec') 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('', function() { + it('renders text that indicates loading', function() { + const wrapper = shallow(); + expect(wrapper.text()).to.match(/loading/i); + }); +}); -- cgit