From 072e4f76f1c98dca9b4a85efa87052842d880d07 Mon Sep 17 00:00:00 2001 From: jpl Date: Tue, 28 Feb 2017 15:03:30 +0100 Subject: Refs #2648: updating jp_collection layout --- spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/javascripts') diff --git a/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js b/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js index 422c97fee..9fcabf439 100644 --- a/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js +++ b/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js @@ -57,13 +57,13 @@ describe('journeyPatterns reducer', () => { type: 'ADD_JOURNEYPATTERN', data: fakeData }) - ).toEqual([...state, { + ).toEqual([{ name : 'm3', published_name: 'M3', registration_number: '', deletable: false, stop_points: fakeStopPoints - }]) + }, ...state]) }) it('should handle UPDATE_CHECKBOX_VALUE', () => { -- cgit v1.2.3 From 886088ed4944865689debc8d821ce04753650e81 Mon Sep 17 00:00:00 2001 From: jpl Date: Tue, 28 Feb 2017 19:20:03 +0100 Subject: Refs #2648: jp_collection refacto, to allow adding a jp from scratch --- .../reducers/journey_patterns_spec.js | 26 +++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'spec/javascripts') diff --git a/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js b/spec/javascripts/journey_patterns/reducers/journey_patterns_spec.js index 9fcabf439..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,6 +71,7 @@ describe('journeyPatterns reducer', () => { published_name: {value: 'M3'}, registration_number: {value: ''} } + let stopPoints = stopPoints expect( jpReducer(state, { type: 'ADD_JOURNEYPATTERN', @@ -62,7 +82,7 @@ describe('journeyPatterns reducer', () => { published_name: 'M3', registration_number: '', deletable: false, - stop_points: fakeStopPoints + stop_points: stopPoints }, ...state]) }) -- cgit v1.2.3