equal
deleted
inserted
replaced
5 |
5 |
6 describe('actions', () => { |
6 describe('actions', () => { |
7 |
7 |
8 it('should create an action to add a note', () => { |
8 it('should create an action to add a note', () => { |
9 const text = 'test note' |
9 const text = 'test note' |
|
10 const session = { id: 'abcd123' } |
10 const expectedAction = { |
11 const expectedAction = { |
11 type: types.ADD_NOTE, |
12 type: types.ADD_NOTE, |
12 note: { |
13 note: { |
13 id: expect.stringMatching(/[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/), |
14 id: expect.stringMatching(/[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}/), |
14 text: text |
15 session: session.id, |
|
16 text: text |
15 } |
17 } |
16 } |
18 } |
17 |
19 |
18 const receivedAction = actions.addNote(text); |
20 const receivedAction = actions.addNote(session, text); |
19 expect(receivedAction).toMatchObject(expectedAction); |
21 expect(receivedAction).toMatchObject(expectedAction); |
20 |
22 |
21 }) |
23 }) |
22 }) |
24 }) |