forked from zoltantothcom/Design-Patterns-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactions.test.js
More file actions
55 lines (50 loc) · 1.28 KB
/
actions.test.js
File metadata and controls
55 lines (50 loc) · 1.28 KB
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
import { start } from '../../src/actions/start';
import { restart } from '../../src/actions/restart';
import { submitAnswer } from '../../src/actions/submitAnswer';
import { toggle, toggleJS, toggleMode } from '../../src/actions/toggle';
import {
SUBMIT,
TOGGLE,
TOGGLE_JS,
TOGGLE_MODE,
START,
RESTART
} from '../../src/static/constants/actions';
describe('Action Creators', () => {
it('should dispatch START action', () => {
expect(start('start')).toEqual({
type: START,
payload: 'start'
});
});
it('should dispatch RESTART action', () => {
expect(restart('restart')).toEqual({
type: RESTART,
payload: 'restart'
});
});
it('should dispatch SUBMIT action', () => {
expect(submitAnswer('submit')).toEqual({
type: SUBMIT,
payload: 'submit'
});
});
it('should dispatch TOGGLE action', () => {
expect(toggle('toggle')).toEqual({
type: TOGGLE,
payload: 'toggle'
});
});
it('should dispatch TOGGLE_JS action', () => {
expect(toggleJS('toggle js')).toEqual({
type: TOGGLE_JS,
payload: 'toggle js'
});
});
it('should dispatch TOGGLE_MODE action', () => {
expect(toggleMode('toggle mode')).toEqual({
type: TOGGLE_MODE,
payload: 'toggle mode'
});
});
});