diff options
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js b/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js index 422c97fee..df288e530 100644 --- a/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js +++ b/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js @@ -6,7 +6,6 @@ let fakeStopPoints = [{ id : 45289, name : "Clichy Levallois", object_id : "FR:92044:LDA:72073:STIF", - object_version : 1, position : 0, },{ area_type : "lda", @@ -14,9 +13,29 @@ let fakeStopPoints = [{ id : 40534, name : "Thomas LemaƮtre", object_id : "FR:92050:LDA:70915:STIF", - object_version : 1, position : 1, }] +let stopPoints = [{ + area_type : 'zdep', + city_name : 'Plaisir', + for_alighting : 'normal', + for_boarding : 'normal', + id : 14892, + name : 'test1', + object_id : 'test:StopPoint:1', + position : 0, + zip_code : '78490' +},{ + area_type : 'zdep', + city_name : 'Plaisir', + for_alighting : 'normal', + for_boarding : 'normal', + id : 14893, + name : 'test2', + object_id : 'test:StopPoint:2', + position : 1, + zip_code : '78490' +}] describe('journeyPatterns reducer', () => { beforeEach(()=>{ @@ -52,18 +71,19 @@ describe('journeyPatterns reducer', () => { published_name: {value: 'M3'}, registration_number: {value: ''} } + let stopPoints = stopPoints expect( jpReducer(state, { type: 'ADD_JOURNEYPATTERN', data: fakeData }) - ).toEqual([...state, { + ).toEqual([{ name : 'm3', published_name: 'M3', registration_number: '', deletable: false, - stop_points: fakeStopPoints - }]) + stop_points: stopPoints + }, ...state]) }) it('should handle UPDATE_CHECKBOX_VALUE', () => { |
