aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts
diff options
context:
space:
mode:
authorThomas Haddad2017-04-14 11:18:02 +0200
committerThomas Haddad2017-04-14 11:18:02 +0200
commit329487ccefb13b4040399bb50c444b0fe97393d4 (patch)
treee574ed0895cd15ffa1659f8208e7ddb4dab293f8 /spec/javascripts
parent9b712c6400a3f99413f47ac4b391686aa3000320 (diff)
downloadchouette-core-329487ccefb13b4040399bb50c444b0fe97393d4.tar.bz2
Refs #2893: add UPDATE_COMMENT action to tt metas
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/time_table/actions_spec.js8
-rw-r--r--spec/javascripts/time_table/reducers/metas_spec.js9
2 files changed, 17 insertions, 0 deletions
diff --git a/spec/javascripts/time_table/actions_spec.js b/spec/javascripts/time_table/actions_spec.js
index 41cec6c0a..79aef0bd1 100644
--- a/spec/javascripts/time_table/actions_spec.js
+++ b/spec/javascripts/time_table/actions_spec.js
@@ -8,4 +8,12 @@ describe('actions', () => {
}
expect(actions.updateDayTypes(1)).toEqual(expectedAction)
})
+
+ it('should create an action to update comment', () => {
+ const expectedAction = {
+ type: 'UPDATE_COMMENT',
+ comment: 'test'
+ }
+ expect(actions.updateComment('test')).toEqual(expectedAction)
+ })
})
diff --git a/spec/javascripts/time_table/reducers/metas_spec.js b/spec/javascripts/time_table/reducers/metas_spec.js
index 5e004c6f4..6ca5c78b9 100644
--- a/spec/javascripts/time_table/reducers/metas_spec.js
+++ b/spec/javascripts/time_table/reducers/metas_spec.js
@@ -28,4 +28,13 @@ describe('status reducer', () => {
).toEqual(Object.assign({}, state, {day_types: arr}))
})
+ it('should handle UPDATE_COMMENT', () => {
+ expect(
+ metasReducer(state, {
+ type: 'UPDATE_COMMENT',
+ comment: 'title'
+ })
+ ).toEqual(Object.assign({}, state, {comment: 'title'}))
+ })
+
})