aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts
diff options
context:
space:
mode:
authorThomas Haddad2017-01-06 16:13:55 +0100
committerThomas Haddad2017-01-06 16:13:55 +0100
commit41ad9d403a69bf36a01a7c61df1a08c0e41a6284 (patch)
treeea5e48eb5fbefabb1e807cd7166e171a76ad7eb2 /spec/javascripts
parent7fe26f12de9a7d1d03e7f0fa4a6372eb987ba97f (diff)
downloadchouette-core-41ad9d403a69bf36a01a7c61df1a08c0e41a6284.tar.bz2
Add first reducer spec and fix journeyPatterns initial state
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/journey_patterns/reducers_spec.js63
1 files changed, 63 insertions, 0 deletions
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([])
+ })
+
+})