aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package.json3
-rw-r--r--spec/javascripts/components_spec.js40
-rw-r--r--spec/javascripts/reducers_spec.js7
-rw-r--r--spec/javascripts/spec_helper.js1
4 files changed, 47 insertions, 4 deletions
diff --git a/package.json b/package.json
index 43f8c4c6a..d2e9a56b7 100644
--- a/package.json
+++ b/package.json
@@ -16,5 +16,8 @@
"license": "MIT",
"engines": {
"node": ">= 0.10"
+ },
+ "devDependencies": {
+ "es6-object-assign": "^1.0.3"
}
}
diff --git a/spec/javascripts/components_spec.js b/spec/javascripts/components_spec.js
new file mode 100644
index 000000000..fc99a3335
--- /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/actions/index');
+var App = require('es6_browserified/components/TodoList');
+var ConnectedApp = require('es6_browserified/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);
+ });
+ });
+});
diff --git a/spec/javascripts/reducers_spec.js b/spec/javascripts/reducers_spec.js
index a4880e73e..985bdc220 100644
--- a/spec/javascripts/reducers_spec.js
+++ b/spec/javascripts/reducers_spec.js
@@ -120,7 +120,7 @@ describe('stops reducer', () => {
})
//TODO unskip when es6 is properly functionnal
- xit('should handle UPDATE_INPUT_VALUE', () => {
+ it('should handle UPDATE_INPUT_VALUE', () => {
expect(
reducer(state, {
type: 'UPDATE_INPUT_VALUE',
@@ -149,7 +149,7 @@ describe('stops reducer', () => {
)
})
- xit('should handle UPDATE_SELECT_VALUE', () => {
+ it('should handle UPDATE_SELECT_VALUE', () => {
expect(
reducer(state, {
type :'UPDATE_SELECT_VALUE',
@@ -160,9 +160,8 @@ describe('stops reducer', () => {
).toEqual(
[
{
- text: 'new value',
+ text: 'first',
index: 0,
- stoparea_id: 1,
for_boarding: 'prohibited',
for_alighting: 'normal'
},
diff --git a/spec/javascripts/spec_helper.js b/spec/javascripts/spec_helper.js
index 71d30ff8d..a2fde3860 100644
--- a/spec/javascripts/spec_helper.js
+++ b/spec/javascripts/spec_helper.js
@@ -4,6 +4,7 @@
// require support/jasmine-jquery-2.1.0
// require support/sinon
// require support/your-support-file
+require('es6-object-assign').polyfill();
//
// PhantomJS (Teaspoons default driver) doesn't have support for Function.prototype.bind, which has caused confusion.
// Use this polyfill to avoid the confusion.