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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
var actions = require('es6_browserified/itineraries/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 move down 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 delete 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 update the value of a stop', () => {
const text = 'updated text'
const index = 1
const expectedAction = {
type: 'UPDATE_INPUT_VALUE',
index,
text
}
expect(actions.updateInputValue(index, text)).toEqual(expectedAction)
})
})
describe('actions', () => {
it('should create an action to update the up select of a stop', () => {
const event = {
currentTarget: {
value: 'forbidden',
id: 'up'
}
}
const index = 1
const expectedAction = {
type :'UPDATE_SELECT_VALUE',
select_id: 'up',
select_value: 'forbidden',
index
}
expect(actions.updateSelectValue(event, index)).toEqual(expectedAction)
})
})
|