aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts/actions_spec.js
blob: 43ebba77f03fbf09f161c3ef1f67a903ab75cab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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)
  })
})