diff options
Diffstat (limited to 'spec/javascripts/components_spec.js')
| -rw-r--r-- | spec/javascripts/components_spec.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/spec/javascripts/components_spec.js b/spec/javascripts/components_spec.js new file mode 100644 index 000000000..c7e541783 --- /dev/null +++ b/spec/javascripts/components_spec.js @@ -0,0 +1,40 @@ +var React = require('react'); +var Provider = require('react-redux').Provider; +var actions = require('es6_browserified/itineraries/actions/index'); +var App = require('es6_browserified/itineraries/components/TodoList'); +var ConnectedApp = require('es6_browserified/itineraries/containers/VisibleTodoList'); +var TestUtils = require('react-addons-test-utils'); + +xdescribe('ConnectedApp', function() { + var connectedApp, store, initialItems; + var state; + state = [ + { + text: 'first', + index: 0, + for_boarding: 'normal', + for_alighting: 'normal' + }, + { + text: 'second', + index: 1, + for_boarding: 'normal', + for_alighting: 'normal' + } + ] + + beforeEach(function() { + store = state + }); + + describe('state provided by the store', function() { + beforeEach(function() { + connectedApp = TestUtils.renderIntoDocument(<Provider store={store}><ConnectedApp/></Provider>); + }); + + it('passes down items', function() { + app = TestUtils.findRenderedComponentWithType(connectedApp, App); + expect(app.props.items).toEqual(initialItems); + }); + }); +}); |
