aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts/itineraries/components_spec.js
blob: c7e541783467ec333567a73963d2eddb35be16a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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);
        });
      });
});