From 41ad9d403a69bf36a01a7c61df1a08c0e41a6284 Mon Sep 17 00:00:00 2001 From: Thomas Haddad Date: Fri, 6 Jan 2017 16:13:55 +0100 Subject: Add first reducer spec and fix journeyPatterns initial state Signed-off-by: Thomas Shawarma Haddad --- spec/javascripts/journey_patterns/reducers_spec.js | 63 ++++++++++++++++++++++ 1 file changed, 63 insertions(+) (limited to 'spec/javascripts') diff --git a/spec/javascripts/journey_patterns/reducers_spec.js b/spec/javascripts/journey_patterns/reducers_spec.js index e69de29bb..ba519dcf4 100644 --- a/spec/javascripts/journey_patterns/reducers_spec.js +++ b/spec/javascripts/journey_patterns/reducers_spec.js @@ -0,0 +1,63 @@ +var jpReducer = require('es6_browserified/journey_patterns/reducers/journeyPatterns') +let state = [] +describe('journeyPatterns reducer', () => { + beforeEach(()=>{ + state = [ + { + deletable: false, + name: 'm1', + object_id : 'o1', + published_name: 'M1', + registration_number: '', + stop_points: [{ + area_type : "lda", + checked : false, + id : 45289, + name : "Clichy Levallois", + object_id : "FR:92044:LDA:72073:STIF", + object_version : 1, + position : 0, + },{ + area_type : "lda", + checked : false, + id : 40534, + name : "Thomas LemaƮtre", + object_id : "FR:92050:LDA:70915:STIF", + object_version : 1, + position : 1, + }] + }, + { + deletable: false, + name: 'm2', + object_id : 'o2', + published_name: 'M2', + registration_number: '', + stop_points: [{ + area_type : "lda", + checked : false, + id : 45289, + name : "Clichy Levallois", + object_id : "FR:92044:LDA:72073:STIF", + object_version : 1, + position : 0, + },{ + area_type : "lda", + checked : false, + id : 40534, + name : "Thomas LemaƮtre", + object_id : "FR:92050:LDA:70915:STIF", + object_version : 1, + position : 1, + }] + }, + ] + }) + + it('should return the initial state', () => { + expect( + jpReducer(undefined, {}) + ).toEqual([]) + }) + +}) -- cgit v1.2.3