diff options
Diffstat (limited to 'spec/javascripts/actions_spec.js')
| -rw-r--r-- | spec/javascripts/actions_spec.js | 52 | 
1 files changed, 52 insertions, 0 deletions
| diff --git a/spec/javascripts/actions_spec.js b/spec/javascripts/actions_spec.js new file mode 100644 index 000000000..43ebba77f --- /dev/null +++ b/spec/javascripts/actions_spec.js @@ -0,0 +1,52 @@ +var actions = require('es6_browserified/actions') + +describe('actions', () => { +  it('should create an action to add a stop', () => { +    const expectedAction = { +      type: 'ADD_STOP', +    } +    expect(actions.addStop()).toEqual(expectedAction) +  }) +}) +describe('actions', () => { +  it('should create an action to move up a stop', () => { +    const index = 1 +    const expectedAction = { +      type: 'MOVE_STOP_UP', +      index +    } +    expect(actions.moveStopUp(index)).toEqual(expectedAction) +  }) +}) +describe('actions', () => { +  it('should create an action to add a stop', () => { +    const index = 1 +    const expectedAction = { +      type: 'MOVE_STOP_DOWN', +      index +    } +    expect(actions.moveStopDown(index)).toEqual(expectedAction) +  }) +}) +describe('actions', () => { +  it('should create an action to add a stop', () => { +    const index = 1 +    const expectedAction = { +      type: 'DELETE_STOP', +      index +    } +    expect(actions.deleteStop(index)).toEqual(expectedAction) +  }) +}) +describe('actions', () => { +  it('should create an action to add a stop', () => { +    const text = 'updated text' +    const index = 1 +    const expectedAction = { +      type: 'UPDATE_INPUT_VALUE', +      index, +      text +    } +    expect(actions.updateInputValue(index, text)).toEqual(expectedAction) +  }) +}) | 
